Commit 716a3cf3 authored by Steve French's avatar Steve French
Browse files

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: default avatarDavid Howells <dhowells@redhat.com>
Reviewed-by: default avatarDavid Howells <dhowells@redhat.com>
Cc: <stable@vger.kernel.org>
Fixes: 087f757b ("cifs: add shutdown support")
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 2cb6f968
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -2709,6 +2709,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 */