Skip to content

Commit 38c03b3

Browse files
committed
ext4: only call sync_filesystm() when remounting read-only
This is the only time it is required for ext4. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
1 parent 02b9984 commit 38c03b3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fs/ext4/super.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4765,8 +4765,6 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
47654765
#endif
47664766
char *orig_data = kstrdup(data, GFP_KERNEL);
47674767

4768-
sync_filesystem(sb);
4769-
47704768
/* Store the original options */
47714769
old_sb_flags = sb->s_flags;
47724770
old_opts.s_mount_opt = sbi->s_mount_opt;
@@ -4837,6 +4835,9 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
48374835
}
48384836

48394837
if (*flags & MS_RDONLY) {
4838+
err = sync_filesystem(sb);
4839+
if (err < 0)
4840+
goto restore_opts;
48404841
err = dquot_suspend(sb, -1);
48414842
if (err < 0)
48424843
goto restore_opts;

0 commit comments

Comments
 (0)