summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorRonnie Sahlberg <lsahlber@redhat.com>2020-01-31 05:52:51 +1000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-02-05 21:22:39 +0000
commitcd0826719560c1f3a42c24742e18a1bb74f5a4d2 (patch)
tree9a9e888d5ee052aa3a3bc9541423e1b621985706 /fs
parent2c38e6140126fa63a32c6d120ae2be59dea571c7 (diff)
downloadlinux-stable-cd0826719560c1f3a42c24742e18a1bb74f5a4d2.tar.gz
linux-stable-cd0826719560c1f3a42c24742e18a1bb74f5a4d2.tar.bz2
linux-stable-cd0826719560c1f3a42c24742e18a1bb74f5a4d2.zip
cifs: fix soft mounts hanging in the reconnect code
commit c54849ddd832ae0a45cab16bcd1ed2db7da090d7 upstream. RHBZ: 1795429 In recent DFS updates we have a new variable controlling how many times we will retry to reconnect the share. If DFS is not used, then this variable is initialized to 0 in: static inline int dfs_cache_get_nr_tgts(const struct dfs_cache_tgt_list *tl) { return tl ? tl->tl_numtgts : 0; } This means that in the reconnect loop in smb2_reconnect() we will immediately wrap retries to -1 and never actually get to pass this conditional: if (--retries) continue; The effect is that we no longer reach the point where we fail the commands with -EHOSTDOWN and basically the kernel threads are virtually hung and unkillable. Fixes: a3a53b7603798fd8 (cifs: Add support for failover in smb2_reconnect()) Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com> Signed-off-by: Steve French <stfrench@microsoft.com> Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz> CC: Stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/smb2pdu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index e1d8cec6ba2e..e1cac715d19e 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -312,7 +312,7 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon)
if (server->tcpStatus != CifsNeedReconnect)
break;
- if (--retries)
+ if (retries && --retries)
continue;
/*