Skip to content

Commit 2883f4b

Browse files
sprasad-microsoftsmfrench
authored andcommitted
cifs: remove unnecessary locking of chan_lock while freeing session
In cifs_put_smb_ses, when we're freeing the last ref count to the session, we need to free up each channel. At this point, it is unnecessary to take chan_lock, since we have the last reference to the ses. Picking up this lock also introduced a deadlock because it calls cifs_put_tcp_ses, which locks cifs_tcp_ses_lock. Signed-off-by: Shyam Prasad N <sprasad@microsoft.com> Acked-by: Enzo Matsumiya <ematsumiya@suse.de> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 50bd7d5 commit 2883f4b

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

fs/cifs/connect.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1918,7 +1918,6 @@ void cifs_put_smb_ses(struct cifs_ses *ses)
19181918
list_del_init(&ses->smb_ses_list);
19191919
spin_unlock(&cifs_tcp_ses_lock);
19201920

1921-
spin_lock(&ses->chan_lock);
19221921
chan_count = ses->chan_count;
19231922

19241923
/* close any extra channels */
@@ -1934,7 +1933,6 @@ void cifs_put_smb_ses(struct cifs_ses *ses)
19341933
ses->chans[i].server = NULL;
19351934
}
19361935
}
1937-
spin_unlock(&ses->chan_lock);
19381936

19391937
sesInfoFree(ses);
19401938
cifs_put_tcp_session(server, 0);

0 commit comments

Comments
 (0)