1 ext4: only call sync_filesystm() when remounting read-only
3 This is the only time it is required for ext4.
5 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
7 fs/ext4/super.c | 5 +++--
8 1 file changed, 3 insertions(+), 2 deletions(-)
10 diff --git a/fs/ext4/super.c b/fs/ext4/super.c
11 index aa3842f..01c5088 100644
14 @@ -4767,8 +4767,6 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
16 char *orig_data = kstrdup(data, GFP_KERNEL);
18 - sync_filesystem(sb);
20 /* Store the original options */
21 old_sb_flags = sb->s_flags;
22 old_opts.s_mount_opt = sbi->s_mount_opt;
23 @@ -4839,6 +4837,9 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
26 if (*flags & MS_RDONLY) {
27 + err = sync_filesystem(sb);
30 err = dquot_suspend(sb, -1);