mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 14:19:16 +00:00
cifs: do not attempt cifs operation on smb2+ rename error
commit 652727bbe1
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>
This commit is contained in:
parent
d5bf783a09
commit
ee231063ff
1 changed files with 4 additions and 0 deletions
|
@ -1735,6 +1735,10 @@ cifs_do_rename(const unsigned int xid, struct dentry *from_dentry,
|
||||||
if (rc == 0 || rc != -EBUSY)
|
if (rc == 0 || rc != -EBUSY)
|
||||||
goto do_rename_exit;
|
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 */
|
/* open-file renames don't work across directories */
|
||||||
if (to_dentry->d_parent != from_dentry->d_parent)
|
if (to_dentry->d_parent != from_dentry->d_parent)
|
||||||
goto do_rename_exit;
|
goto do_rename_exit;
|
||||||
|
|
Loading…
Reference in a new issue