cifs: fix soft mounts hanging in the reconnect code
authorRonnie Sahlberg <lsahlber@redhat.com>
Thu, 6 Feb 2020 03:55:19 +0000 (13:55 +1000)
committerSteve French <stfrench@microsoft.com>
Thu, 6 Feb 2020 15:12:00 +0000 (09:12 -0600)
commit09c40b15351c1bb1af035f7f6df167366d552790
tree9fde04f64f40ecec0a522d6903689afc0952f075
parentf2bf09e97b47c7b13e8a918f560f6082e9bc8f8a
cifs: fix soft mounts hanging in the reconnect code

RHBZ: 1795423

This is the SMB1 version of a patch we already have for SMB2

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.

Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
fs/cifs/cifssmb.c