Skip to content

Commit c3326a6

Browse files
sprasad-microsoftsmfrench
authored andcommitted
cifs: reconnect helper should set reconnect for the right channel
We introduced a helper function to be used by non-cifsd threads to mark the connection for reconnect. For multichannel, when only a particular channel needs to be reconnected, this had a bug. This change fixes that by marking that particular channel for reconnect. Fixes: dca6581 ("cifs: use a different reconnect helper for non-cifsd threads") Cc: stable@vger.kernel.org Signed-off-by: Shyam Prasad N <sprasad@microsoft.com> Reviewed-by: Paulo Alcantara (SUSE) <pc@manguebit.com> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 5c86919 commit c3326a6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

fs/smb/client/connect.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,13 +160,14 @@ cifs_signal_cifsd_for_reconnect(struct TCP_Server_Info *server,
160160
/* If server is a channel, select the primary channel */
161161
pserver = SERVER_IS_CHAN(server) ? server->primary_server : server;
162162

163-
spin_lock(&pserver->srv_lock);
163+
/* if we need to signal just this channel */
164164
if (!all_channels) {
165-
pserver->tcpStatus = CifsNeedReconnect;
166-
spin_unlock(&pserver->srv_lock);
165+
spin_lock(&server->srv_lock);
166+
if (server->tcpStatus != CifsExiting)
167+
server->tcpStatus = CifsNeedReconnect;
168+
spin_unlock(&server->srv_lock);
167169
return;
168170
}
169-
spin_unlock(&pserver->srv_lock);
170171

171172
spin_lock(&cifs_tcp_ses_lock);
172173
list_for_each_entry(ses, &pserver->smb_ses_list, smb_ses_list) {

0 commit comments

Comments
 (0)