lkml.org 
[lkml]   [2020]   [Jun]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/2] exfat: call sync_filesystem for read-only remount
Date
We need to commit dirty metadata and pages to disk
before remounting exfat as read-only.

This fixes a failure in xfstests generic/452

Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
---
fs/exfat/super.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)

diff --git a/fs/exfat/super.c b/fs/exfat/super.c
index e650e65536f8..61c6cf240c19 100644
--- a/fs/exfat/super.c
+++ b/fs/exfat/super.c
@@ -693,10 +693,29 @@ static void exfat_free(struct fs_context *fc)
}
}

+static int exfat_reconfigure(struct fs_context *fc)
+{
+ struct super_block *sb = fc->root->d_sb;
+ int ret;
+ bool new_rdonly;
+
+ new_rdonly = fc->sb_flags & SB_RDONLY;
+ if (new_rdonly != sb_rdonly(sb)) {
+ if (new_rdonly) {
+ /* volume flag will be updated in exfat_sync_fs */
+ ret = sync_filesystem(sb);
+ if (ret < 0)
+ return ret;
+ }
+ }
+ 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)
--
2.17.1
\
 
 \ /
  Last update: 2020-06-12 12:14    [W:0.066 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site