Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGoldwyn Rodrigues <rgoldwyn@suse.com>2018-10-15 10:54:26 -0500
committerGoldwyn Rodrigues <rgoldwyn@suse.com>2018-10-15 10:54:41 -0500
commitff5cd46a98f49c7e38f8c7e8f55e17ec2b85311c (patch)
tree4c59e94ccc316e9f1149562bf60030c0fd28c1b2
parent2624e2e94896a8946b30b29a637780c07cd9acc5 (diff)
ovl: Sync upper dirty data when syncing overlayfs (git-fixes).
-rw-r--r--patches.fixes/ovl-Sync-upper-dirty-data-when-syncing-overlayfs.patch61
-rw-r--r--series.conf1
2 files changed, 62 insertions, 0 deletions
diff --git a/patches.fixes/ovl-Sync-upper-dirty-data-when-syncing-overlayfs.patch b/patches.fixes/ovl-Sync-upper-dirty-data-when-syncing-overlayfs.patch
new file mode 100644
index 0000000000..173cf3670b
--- /dev/null
+++ b/patches.fixes/ovl-Sync-upper-dirty-data-when-syncing-overlayfs.patch
@@ -0,0 +1,61 @@
+From e8d4bfe3a71537284a90561f77c85dea6c154369 Mon Sep 17 00:00:00 2001
+From: Chengguang Xu <cgxu@mykernel.net>
+Date: Wed Nov 29 10:01:32 2017 +0800
+Subject: [PATCH] ovl: Sync upper dirty data when syncing overlayfs
+Git-commit: e8d4bfe3a71537284a90561f77c85dea6c154369
+References: git-fixes
+Patch-mainline: v4.15-rc4
+
+When executing filesystem sync or umount on overlayfs,
+dirty data does not get synced as expected on upper filesystem.
+This patch fixes sync filesystem method to keep data consistency
+for overlayfs.
+
+Signed-off-by: Chengguang Xu <cgxu@mykernel.net>
+Fixes: e593b2bf513d ("ovl: properly implement sync_filesystem()")
+Cc: <stable@vger.kernel.org> #4.11
+Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
+Acked-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
+
+---
+ fs/overlayfs/super.c | 17 ++++++++++++++---
+ 1 file changed, 14 insertions(+), 3 deletions(-)
+
+--- a/fs/overlayfs/super.c
++++ b/fs/overlayfs/super.c
+@@ -183,6 +183,7 @@ static void ovl_put_super(struct super_b
+ kfree(ufs);
+ }
+
++/* Sync real dirty inodes in upper filesystem (if it exists) */
+ static int ovl_sync_fs(struct super_block *sb, int wait)
+ {
+ struct ovl_fs *ufs = sb->s_fs_info;
+@@ -191,14 +192,24 @@ static int ovl_sync_fs(struct super_bloc
+
+ if (!ufs->upper_mnt)
+ return 0;
+- upper_sb = ufs->upper_mnt->mnt_sb;
+- if (!upper_sb->s_op->sync_fs)
++ /*
++ * If this is a sync(2) call or an emergency sync, all the super blocks
++ * will be iterated, including upper_sb, so no need to do anything.
++ *
++ * If this is a syncfs(2) call, then we do need to call
++ * sync_filesystem() on upper_sb, but enough if we do it when being
++ * called with wait == 1.
++ */
++ if (!wait)
+ return 0;
+
+ /* real inodes have already been synced by sync_filesystem(ovl_sb) */
++ upper_sb = ufs->upper_mnt->mnt_sb;
++
+ down_read(&upper_sb->s_umount);
+- ret = upper_sb->s_op->sync_fs(upper_sb, wait);
++ ret = sync_filesystem(upper_sb);
+ up_read(&upper_sb->s_umount);
++
+ return ret;
+ }
+
diff --git a/series.conf b/series.conf
index 01c5959f31..a1e56fdef5 100644
--- a/series.conf
+++ b/series.conf
@@ -10582,6 +10582,7 @@
patches.arch/0003-arm64-mm-Fix-false-positives-in-set_pte_at-access-di.patch
patches.suse/0005-arm64-Define-cputype-macros-for-Falkor-CPU.patch
patches.arch/0001-arm64-fix-CONFIG_DEBUG_WX-address-reporting.patch
+ patches.fixes/ovl-Sync-upper-dirty-data-when-syncing-overlayfs.patch
patches.fixes/ceph-drop-negative-child-dentries-before-try-pruning-inode-s-alias.patch
patches.drivers/scsi-lpfc-Use-after-free-in-lpfc_rq_buf_free.patch
patches.drivers/libfc-fix-ELS-request-handling.patch