]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
cifs: do not attempt cifs operation on smb2+ rename error
authorFrank Sorenson <sorenson@redhat.com>
Tue, 16 Apr 2019 13:37:27 +0000 (08:37 -0500)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 13 Aug 2019 11:39:14 +0000 (12:39 +0100)
commit 652727bbe1b17993636346716ae5867627793647 upstream.

A path-based rename returning EBUSY will incorrectly try opening
the file with a cifs (NT Create AndX) operation on an smb2+ mount,
which causes the server to force a session close.

If the mount is smb2+, skip the fallback.

Signed-off-by: Frank Sorenson <sorenson@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/cifs/inode.c

index 09ca7c978700b6c68b20c61464dfe935de0ba336..f681091ec3db72d6daa4b542bca17901d980d221 100644 (file)
@@ -1627,6 +1627,10 @@ cifs_do_rename(const unsigned int xid, struct dentry *from_dentry,
        if (rc == 0 || rc != -EBUSY)
                goto do_rename_exit;
 
+       /* Don't fall back to using SMB on SMB 2+ mount */
+       if (server->vals->protocol_id != 0)
+               goto do_rename_exit;
+
        /* open-file renames don't work across directories */
        if (to_dentry->d_parent != from_dentry->d_parent)
                goto do_rename_exit;