From b07a403c094b94db2a968541bc9cdea7d6532690 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 29 Apr 2019 10:17:15 +0200 Subject: [PATCH] 4.4-stable patches added patches: cifs-do-not-attempt-cifs-operation-on-smb2-rename-error.patch --- ...-cifs-operation-on-smb2-rename-error.patch | 38 +++++++++++++++++++ queue-4.4/series | 1 + 2 files changed, 39 insertions(+) create mode 100644 queue-4.4/cifs-do-not-attempt-cifs-operation-on-smb2-rename-error.patch diff --git a/queue-4.4/cifs-do-not-attempt-cifs-operation-on-smb2-rename-error.patch b/queue-4.4/cifs-do-not-attempt-cifs-operation-on-smb2-rename-error.patch new file mode 100644 index 00000000000..93353721d6b --- /dev/null +++ b/queue-4.4/cifs-do-not-attempt-cifs-operation-on-smb2-rename-error.patch @@ -0,0 +1,38 @@ +From 652727bbe1b17993636346716ae5867627793647 Mon Sep 17 00:00:00 2001 +From: Frank Sorenson +Date: Tue, 16 Apr 2019 08:37:27 -0500 +Subject: cifs: do not attempt cifs operation on smb2+ rename error + +From: Frank Sorenson + +commit 652727bbe1b17993636346716ae5867627793647 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 +Signed-off-by: Steve French +CC: Stable +Reviewed-by: Ronnie Sahlberg +Signed-off-by: Greg Kroah-Hartman + +--- + fs/cifs/inode.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/fs/cifs/inode.c ++++ b/fs/cifs/inode.c +@@ -1669,6 +1669,10 @@ cifs_do_rename(const unsigned int xid, s + 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; diff --git a/queue-4.4/series b/queue-4.4/series index f6fe4983e6b..343c28113fe 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -1,2 +1,3 @@ kbuild-simplify-ld-option-implementation.patch kvm-fail-kvm_set_vcpu_events-with-invalid-exception-.patch +cifs-do-not-attempt-cifs-operation-on-smb2-rename-error.patch -- 2.47.2