This is the only time it is required for ext4.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
#endif
char *orig_data = kstrdup(data, GFP_KERNEL);
- sync_filesystem(sb);
-
/* Store the original options */
old_sb_flags = sb->s_flags;
old_opts.s_mount_opt = sbi->s_mount_opt;
}
if (*flags & MS_RDONLY) {
+ err = sync_filesystem(sb);
+ if (err < 0)
+ goto restore_opts;
err = dquot_suspend(sb, -1);
if (err < 0)
goto restore_opts;