Skip to content

Commit 716a3cf

Browse files
committed
smb3: fix problem remounting a share after shutdown
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 <[email protected]> Reviewed-by: David Howells <[email protected]> Cc: <[email protected]> Fixes: 087f757 ("cifs: add shutdown support") Signed-off-by: Steve French <[email protected]>
1 parent 2cb6f96 commit 716a3cf

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

fs/cifs/connect.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2709,6 +2709,13 @@ cifs_match_super(struct super_block *sb, void *data)
27092709

27102710
spin_lock(&cifs_tcp_ses_lock);
27112711
cifs_sb = CIFS_SB(sb);
2712+
2713+
/* We do not want to use a superblock that has been shutdown */
2714+
if (CIFS_MOUNT_SHUTDOWN & cifs_sb->mnt_cifs_flags) {
2715+
spin_unlock(&cifs_tcp_ses_lock);
2716+
return 0;
2717+
}
2718+
27122719
tlink = cifs_get_tlink(cifs_sb_master_tlink(cifs_sb));
27132720
if (tlink == NULL) {
27142721
/* can not match superblock if tlink were ever null */

0 commit comments

Comments
 (0)