]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/5.0.11/cifs-do-not-attempt-cifs-operation-on-smb2-rename-error.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 5.0.11 / cifs-do-not-attempt-cifs-operation-on-smb2-rename-error.patch
CommitLineData
65a46afe
GKH
1From 652727bbe1b17993636346716ae5867627793647 Mon Sep 17 00:00:00 2001
2From: Frank Sorenson <sorenson@redhat.com>
3Date: Tue, 16 Apr 2019 08:37:27 -0500
4Subject: cifs: do not attempt cifs operation on smb2+ rename error
5
6From: Frank Sorenson <sorenson@redhat.com>
7
8commit 652727bbe1b17993636346716ae5867627793647 upstream.
9
10A path-based rename returning EBUSY will incorrectly try opening
11the file with a cifs (NT Create AndX) operation on an smb2+ mount,
12which causes the server to force a session close.
13
14If the mount is smb2+, skip the fallback.
15
16Signed-off-by: Frank Sorenson <sorenson@redhat.com>
17Signed-off-by: Steve French <stfrench@microsoft.com>
18CC: Stable <stable@vger.kernel.org>
19Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
20Signed-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@@ -1735,6 +1735,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;