This is a note to let you know that I've just added the patch titled smb3: fix problem remounting a share after shutdown to the 6.1-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: smb3-fix-problem-remounting-a-share-after-shutdown.patch and it can be found in the queue-6.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 716a3cf317456fa01d54398bb14ab354f50ed6a2 Mon Sep 17 00:00:00 2001 From: Steve French <stfrench@xxxxxxxxxxxxx> Date: Tue, 9 May 2023 01:37:19 -0500 Subject: smb3: fix problem remounting a share after shutdown From: Steve French <stfrench@xxxxxxxxxxxxx> 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@xxxxxxxxxx> Reviewed-by: David Howells <dhowells@xxxxxxxxxx> Cc: <stable@xxxxxxxxxxxxxxx> Fixes: 087f757b0129 ("cifs: add shutdown support") Signed-off-by: Steve French <stfrench@xxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/cifs/connect.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -2742,6 +2742,13 @@ cifs_match_super(struct super_block *sb, 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 */ Patches currently in stable-queue which might be from stfrench@xxxxxxxxxxxxx are queue-6.1/cifs-fix-pcchunk-length-type-in-smb2_copychunk_range.patch queue-6.1/smb3-fix-problem-remounting-a-share-after-shutdown.patch queue-6.1/cifs-release-leases-for-deferred-close-handles-when-freezing.patch queue-6.1/smb3-force-unmount-was-failing-to-close-deferred-close-files.patch