From 007bb3005d40164d0067e618cf25f49de3c016a1 Mon Sep 17 00:00:00 2001
From: Steve French <stfrench@microsoft.com>
Date: Sat, 3 Nov 2018 23:24:26 -0500
Subject: [PATCH] smb3: do not call cifs functions in error path in rename
If the server returned EBUSY during rename we could fall back to SMB1 in an
error path when using SMB2/SMB3. Make sure we check the dialect before
calling CIFS_open there.
Signed-off-by: Steve French <stfrench@microsoft.com>
---
fs/cifs/inode.c | 4 ++++
1 file changed, 4 insertions(+)
@@ -1743,6 +1743,10 @@ cifs_do_rename(const unsigned int xid, struct dentry *from_dentry,
if (to_dentry->d_parent != from_dentry->d_parent)
goto do_rename_exit;
+ /* If not CIFS (vers=1.0) do not call CIFS/SMB1 functions below */
+ if (strcmp(server->vals->version_string, SMB1_VERSION_STRING) != 0)
+ goto do_rename_exit;
+
oparms.tcon = tcon;
oparms.cifs_sb = cifs_sb;
/* open the file to be renamed -- we need DELETE perms */
--
2.17.1
If the server returned EBUSY during rename we could fall back to SMB1 in an error path when using SMB2/SMB3. Make sure we check the dialect before calling CIFS_open there. Signed-off-by: Steve French <stfrench@microsoft.com> --- fs/cifs/inode.c | 4 ++++ 1 file changed, 4 insertions(+) /* open the file to be renamed -- we need DELETE perms */