summaryrefslogtreecommitdiff
path: root/fs/cifs
diff options
context:
space:
mode:
authorFrank Sorenson <sorenson@redhat.com>2019-04-16 08:37:27 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-16 19:44:43 +0200
commitfd49607468bacd5003cd146de2c4e0f135bff777 (patch)
tree8bb8add6c722ae63dd2b487ec23d7f19d19595c0 /fs/cifs
parent4c78eadb34894fec0d759853448f441173982120 (diff)
cifs: do not attempt cifs operation on smb2+ rename error
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> CC: Stable <stable@vger.kernel.org> Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/inode.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index d8bd8dd36211..0f210cb5038a 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -1669,6 +1669,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;