]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.16-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 May 2018 09:19:39 +0000 (11:19 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 May 2018 09:19:39 +0000 (11:19 +0200)
added patches:
smb3-directory-sync-should-not-return-an-error.patch

queue-4.16/series
queue-4.16/smb3-directory-sync-should-not-return-an-error.patch [new file with mode: 0644]

index 5655aa1d39c0269b65fa4585b3154d91e996b681..17a26d1c774bd38ca7adea40ce26f073ae9d4a86 100644 (file)
@@ -60,3 +60,4 @@ thermal-exynos-reading-temperature-makes-sense-only-when-tmu-is-turned-on.patch
 thermal-exynos-propagate-error-value-from-tmu_read.patch
 nvme-add-quirk-to-force-medium-priority-for-sq-creation.patch
 nvme-fix-sync-controller-reset-return.patch
+smb3-directory-sync-should-not-return-an-error.patch
diff --git a/queue-4.16/smb3-directory-sync-should-not-return-an-error.patch b/queue-4.16/smb3-directory-sync-should-not-return-an-error.patch
new file mode 100644 (file)
index 0000000..f260a2b
--- /dev/null
@@ -0,0 +1,53 @@
+From 6e70c267e68d77679534dcf4aaf84e66f2cf1425 Mon Sep 17 00:00:00 2001
+From: Steve French <smfrench@gmail.com>
+Date: Thu, 10 May 2018 10:59:37 -0500
+Subject: smb3: directory sync should not return an error
+
+From: Steve French <smfrench@gmail.com>
+
+commit 6e70c267e68d77679534dcf4aaf84e66f2cf1425 upstream.
+
+As with NFS, which ignores sync on directory handles,
+fsync on a directory handle is a noop for CIFS/SMB3.
+Do not return an error on it.  It breaks some database
+apps otherwise.
+
+Signed-off-by: Steve French <smfrench@gmail.com>
+CC: Stable <stable@vger.kernel.org>
+Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
+Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/cifs/cifsfs.c |   13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+--- a/fs/cifs/cifsfs.c
++++ b/fs/cifs/cifsfs.c
+@@ -1047,6 +1047,18 @@ out:
+       return rc;
+ }
++/*
++ * Directory operations under CIFS/SMB2/SMB3 are synchronous, so fsync()
++ * is a dummy operation.
++ */
++static int cifs_dir_fsync(struct file *file, loff_t start, loff_t end, int datasync)
++{
++      cifs_dbg(FYI, "Sync directory - name: %pD datasync: 0x%x\n",
++               file, datasync);
++
++      return 0;
++}
++
+ static ssize_t cifs_copy_file_range(struct file *src_file, loff_t off,
+                               struct file *dst_file, loff_t destoff,
+                               size_t len, unsigned int flags)
+@@ -1181,6 +1193,7 @@ const struct file_operations cifs_dir_op
+       .copy_file_range = cifs_copy_file_range,
+       .clone_file_range = cifs_clone_file_range,
+       .llseek = generic_file_llseek,
++      .fsync = cifs_dir_fsync,
+ };
+ static void