diff options
author | Hyunchul Lee <hyc.lee@gmail.com> | 2020-06-16 08:34:45 +0300 |
---|---|---|
committer | Namjae Jeon <namjae.jeon@samsung.com> | 2020-06-29 11:11:08 +0300 |
commit | a0271a15cf2cf907ea5b0f2ba611123f1b7935ec (patch) | |
tree | e0efb71a4fa40845babf0d630be9a9634ff24d03 /fs/exfat/super.c | |
parent | e8dd3cda8667118b70d9fe527f61fe22623de04d (diff) | |
download | linux-a0271a15cf2cf907ea5b0f2ba611123f1b7935ec.tar.xz |
exfat: call sync_filesystem for read-only remount
We need to commit dirty metadata and pages to disk
before remounting exfat as read-only.
This fixes a failure in xfstests generic/452
generic/452 does the following:
cp something <exfat>/
mount -o remount,ro <exfat>
the <exfat>/something is corrupted. because while
exfat is remounted as read-only, exfat doesn't
have a chance to commit metadata and
vfs invalidates page caches in a block device.
Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
Acked-by: Sungjong Seo <sj1557.seo@samsung.com>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Diffstat (limited to 'fs/exfat/super.c')
-rw-r--r-- | fs/exfat/super.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/exfat/super.c b/fs/exfat/super.c index e650e65536f8..253a92460d52 100644 --- a/fs/exfat/super.c +++ b/fs/exfat/super.c @@ -693,10 +693,20 @@ static void exfat_free(struct fs_context *fc) } } +static int exfat_reconfigure(struct fs_context *fc) +{ + fc->sb_flags |= SB_NODIRATIME; + + /* volume flag will be updated in exfat_sync_fs */ + sync_filesystem(fc->root->d_sb); + return 0; +} + static const struct fs_context_operations exfat_context_ops = { .parse_param = exfat_parse_param, .get_tree = exfat_get_tree, .free = exfat_free, + .reconfigure = exfat_reconfigure, }; static int exfat_init_fs_context(struct fs_context *fc) |