Skip to content

Commit 66be5c4

Browse files
winnscodesmfrench
authored andcommitted
cifs: fix session state check in smb2_find_smb_ses
Chech the session state and skip it if it's exiting. Signed-off-by: Winston Wen <[email protected]> Reviewed-by: Shyam Prasad N <[email protected]> Cc: [email protected] Signed-off-by: Steve French <[email protected]>
1 parent 99f2807 commit 66be5c4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

fs/smb/client/smb2transport.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,14 @@ smb2_find_smb_ses_unlocked(struct TCP_Server_Info *server, __u64 ses_id)
153153
list_for_each_entry(ses, &pserver->smb_ses_list, smb_ses_list) {
154154
if (ses->Suid != ses_id)
155155
continue;
156+
157+
spin_lock(&ses->ses_lock);
158+
if (ses->ses_status == SES_EXITING) {
159+
spin_unlock(&ses->ses_lock);
160+
continue;
161+
}
156162
++ses->ses_count;
163+
spin_unlock(&ses->ses_lock);
157164
return ses;
158165
}
159166

0 commit comments

Comments
 (0)