cifs: fix session state check in smb2_find_smb_ses
commit 66be5c48ee1b5b8c919cc329fe6d32e16badaa40 upstream. Chech the session state and skip it if it's exiting. Signed-off-by: Winston Wen <wentao@uniontech.com> Reviewed-by: Shyam Prasad N <sprasad@microsoft.com> Cc: stable@vger.kernel.org Signed-off-by: Steve French <stfrench@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
c4a5fb1ae5
commit
40e2ed0e56
@ -153,7 +153,14 @@ smb2_find_smb_ses_unlocked(struct TCP_Server_Info *server, __u64 ses_id)
|
|||||||
list_for_each_entry(ses, &pserver->smb_ses_list, smb_ses_list) {
|
list_for_each_entry(ses, &pserver->smb_ses_list, smb_ses_list) {
|
||||||
if (ses->Suid != ses_id)
|
if (ses->Suid != ses_id)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
spin_lock(&ses->ses_lock);
|
||||||
|
if (ses->ses_status == SES_EXITING) {
|
||||||
|
spin_unlock(&ses->ses_lock);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
++ses->ses_count;
|
++ses->ses_count;
|
||||||
|
spin_unlock(&ses->ses_lock);
|
||||||
return ses;
|
return ses;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user