diff options
author | Frank Sorenson <sorenson@redhat.com> | 2019-04-16 15:37:27 +0200 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2019-04-24 19:33:59 +0200 |
commit | 652727bbe1b17993636346716ae5867627793647 (patch) | |
tree | d0c67021774a1e2c34feed31ff224e259ee9a5ca /fs/cifs/inode.c | |
parent | cifs: fix memory leak in SMB2_read (diff) | |
download | linux-652727bbe1b17993636346716ae5867627793647.tar.xz linux-652727bbe1b17993636346716ae5867627793647.zip |
cifs: do not attempt cifs operation on smb2+ rename error
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>
Diffstat (limited to 'fs/cifs/inode.c')
-rw-r--r-- | fs/cifs/inode.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 53fdb5df0d2e..538fd7d807e4 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -1735,6 +1735,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; |