Skip to content

Commit 687127c

Browse files
Paulo Alcantarasmfrench
authored andcommitted
cifs: fix potential race with cifsd thread
To avoid racing with demultiplex thread while it is handling data on socket, use cifs_signal_cifsd_for_reconnect() helper for marking current server to reconnect and let the demultiplex thread handle the rest. Fixes: dca6581 ("cifs: use a different reconnect helper for non-cifsd threads") Reviewed-by: Enzo Matsumiya <ematsumiya@suse.de> Reviewed-by: Shyam Prasad N <sprasad@microsoft.com> Signed-off-by: Paulo Alcantara (SUSE) <pc@cjr.nz> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 3123109 commit 687127c

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

fs/cifs/connect.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4465,7 +4465,7 @@ static int tree_connect_dfs_target(const unsigned int xid, struct cifs_tcon *tco
44654465
*/
44664466
if (rc && server->current_fullpath != server->origin_fullpath) {
44674467
server->current_fullpath = server->origin_fullpath;
4468-
cifs_reconnect(tcon->ses->server, true);
4468+
cifs_signal_cifsd_for_reconnect(server, true);
44694469
}
44704470

44714471
dfs_cache_free_tgts(tl);

fs/cifs/netmisc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,7 @@ map_and_check_smb_error(struct mid_q_entry *mid, bool logErr)
896896
if (class == ERRSRV && code == ERRbaduid) {
897897
cifs_dbg(FYI, "Server returned 0x%x, reconnecting session...\n",
898898
code);
899-
cifs_reconnect(mid->server, false);
899+
cifs_signal_cifsd_for_reconnect(mid->server, false);
900900
}
901901
}
902902

0 commit comments

Comments
 (0)