|
Kmods SIG |
50e2b3 |
From a0271a15cf2cf907ea5b0f2ba611123f1b7935ec Mon Sep 17 00:00:00 2001
|
|
Kmods SIG |
50e2b3 |
From: Hyunchul Lee <hyc.lee@gmail.com>
|
|
Kmods SIG |
50e2b3 |
Date: Tue, 16 Jun 2020 14:34:45 +0900
|
|
Kmods SIG |
50e2b3 |
Subject: [Backport a0271a15cf2c] exfat: call sync_filesystem for read-only
|
|
Kmods SIG |
50e2b3 |
remount
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
We need to commit dirty metadata and pages to disk
|
|
Kmods SIG |
50e2b3 |
before remounting exfat as read-only.
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
This fixes a failure in xfstests generic/452
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
generic/452 does the following:
|
|
Kmods SIG |
50e2b3 |
cp something <exfat>/
|
|
Kmods SIG |
50e2b3 |
mount -o remount,ro <exfat>
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
the <exfat>/something is corrupted. because while
|
|
Kmods SIG |
50e2b3 |
exfat is remounted as read-only, exfat doesn't
|
|
Kmods SIG |
50e2b3 |
have a chance to commit metadata and
|
|
Kmods SIG |
50e2b3 |
vfs invalidates page caches in a block device.
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
|
|
Kmods SIG |
50e2b3 |
Acked-by: Sungjong Seo <sj1557.seo@samsung.com>
|
|
Kmods SIG |
50e2b3 |
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
|
|
Kmods SIG |
50e2b3 |
---
|
|
Kmods SIG |
50e2b3 |
src/super.c | 10 ++++++++++
|
|
Kmods SIG |
50e2b3 |
1 file changed, 10 insertions(+)
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
diff --git a/src/super.c b/src/super.c
|
|
Kmods SIG |
50e2b3 |
index e650e65536f848c544b731f273b5f8839298e850..253a92460d5222f4f3aa75e52fc0b3eab084bc06 100644
|
|
Kmods SIG |
50e2b3 |
--- a/src/super.c
|
|
Kmods SIG |
50e2b3 |
+++ b/src/super.c
|
|
Kmods SIG |
50e2b3 |
@@ -693,10 +693,20 @@ static void exfat_free(struct fs_context *fc)
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
+static int exfat_reconfigure(struct fs_context *fc)
|
|
Kmods SIG |
50e2b3 |
+{
|
|
Kmods SIG |
50e2b3 |
+ fc->sb_flags |= SB_NODIRATIME;
|
|
Kmods SIG |
50e2b3 |
+
|
|
Kmods SIG |
50e2b3 |
+ /* volume flag will be updated in exfat_sync_fs */
|
|
Kmods SIG |
50e2b3 |
+ sync_filesystem(fc->root->d_sb);
|
|
Kmods SIG |
50e2b3 |
+ return 0;
|
|
Kmods SIG |
50e2b3 |
+}
|
|
Kmods SIG |
50e2b3 |
+
|
|
Kmods SIG |
50e2b3 |
static const struct fs_context_operations exfat_context_ops = {
|
|
Kmods SIG |
50e2b3 |
.parse_param = exfat_parse_param,
|
|
Kmods SIG |
50e2b3 |
.get_tree = exfat_get_tree,
|
|
Kmods SIG |
50e2b3 |
.free = exfat_free,
|
|
Kmods SIG |
50e2b3 |
+ .reconfigure = exfat_reconfigure,
|
|
Kmods SIG |
50e2b3 |
};
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
static int exfat_init_fs_context(struct fs_context *fc)
|
|
Kmods SIG |
50e2b3 |
--
|
|
Kmods SIG |
50e2b3 |
2.31.1
|
|
Kmods SIG |
50e2b3 |
|