diff options
author | Steve French <stfrench@microsoft.com> | 2023-05-09 01:37:19 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-05-17 14:01:55 +0200 |
commit | 61cb595f56c80e16e85951f6e2a341b5a9d9b2cf (patch) | |
tree | 98d83a38e44dc4218d040f99d41a5966aee770b3 /fs | |
parent | a48bacee05860c6089c3482bcdc80720b0ee5732 (diff) | |
download | linux-stable-61cb595f56c80e16e85951f6e2a341b5a9d9b2cf.tar.gz linux-stable-61cb595f56c80e16e85951f6e2a341b5a9d9b2cf.tar.bz2 linux-stable-61cb595f56c80e16e85951f6e2a341b5a9d9b2cf.zip |
smb3: fix problem remounting a share after shutdown
commit 716a3cf317456fa01d54398bb14ab354f50ed6a2 upstream.
xfstests generic/392 showed a problem where even after a
shutdown call was made on a mount, we would still attempt
to use the (now inaccessible) superblock if another mount
was attempted for the same share.
Reported-by: David Howells <dhowells@redhat.com>
Reviewed-by: David Howells <dhowells@redhat.com>
Cc: <stable@vger.kernel.org>
Fixes: 087f757b0129 ("cifs: add shutdown support")
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cifs/connect.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 2c573062ec87..59a10330e299 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -2705,6 +2705,13 @@ cifs_match_super(struct super_block *sb, void *data) spin_lock(&cifs_tcp_ses_lock); cifs_sb = CIFS_SB(sb); + + /* We do not want to use a superblock that has been shutdown */ + if (CIFS_MOUNT_SHUTDOWN & cifs_sb->mnt_cifs_flags) { + spin_unlock(&cifs_tcp_ses_lock); + return 0; + } + tlink = cifs_get_tlink(cifs_sb_master_tlink(cifs_sb)); if (tlink == NULL) { /* can not match superblock if tlink were ever null */ |