]>
Commit | Line | Data |
---|---|---|
b07a403c GKH |
1 | From 652727bbe1b17993636346716ae5867627793647 Mon Sep 17 00:00:00 2001 |
2 | From: Frank Sorenson <sorenson@redhat.com> | |
3 | Date: Tue, 16 Apr 2019 08:37:27 -0500 | |
4 | Subject: cifs: do not attempt cifs operation on smb2+ rename error | |
5 | ||
6 | From: Frank Sorenson <sorenson@redhat.com> | |
7 | ||
8 | commit 652727bbe1b17993636346716ae5867627793647 upstream. | |
9 | ||
10 | A path-based rename returning EBUSY will incorrectly try opening | |
11 | the file with a cifs (NT Create AndX) operation on an smb2+ mount, | |
12 | which causes the server to force a session close. | |
13 | ||
14 | If the mount is smb2+, skip the fallback. | |
15 | ||
16 | Signed-off-by: Frank Sorenson <sorenson@redhat.com> | |
17 | Signed-off-by: Steve French <stfrench@microsoft.com> | |
18 | CC: Stable <stable@vger.kernel.org> | |
19 | Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com> | |
20 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
21 | ||
22 | --- | |
23 | fs/cifs/inode.c | 4 ++++ | |
24 | 1 file changed, 4 insertions(+) | |
25 | ||
26 | --- a/fs/cifs/inode.c | |
27 | +++ b/fs/cifs/inode.c | |
28 | @@ -1669,6 +1669,10 @@ cifs_do_rename(const unsigned int xid, s | |
29 | if (rc == 0 || rc != -EBUSY) | |
30 | goto do_rename_exit; | |
31 | ||
32 | + /* Don't fall back to using SMB on SMB 2+ mount */ | |
33 | + if (server->vals->protocol_id != 0) | |
34 | + goto do_rename_exit; | |
35 | + | |
36 | /* open-file renames don't work across directories */ | |
37 | if (to_dentry->d_parent != from_dentry->d_parent) | |
38 | goto do_rename_exit; |