f2fs: enable quota at remount from r to w
authorJaegeuk Kim <jaegeuk@kernel.org>
Tue, 2 Jan 2018 19:03:19 +0000 (11:03 -0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Sat, 27 Jan 2018 21:29:48 +0000 (13:29 -0800)
We have to enable quota only when remounting from read to write. Otherwise,
we'll get remount failure. (e.g., write to write case)

Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/super.c

index cb876d905ca591638955d209223805848f0164a2..5c6a02b558f0bc16b8c7f6b46b6e73d7f8642eb1 100644 (file)
@@ -1265,7 +1265,7 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data)
                err = dquot_suspend(sb, -1);
                if (err < 0)
                        goto restore_opts;
-       } else {
+       } else if (f2fs_readonly(sb) && !(*flags & MS_RDONLY)) {
                /* dquot_resume needs RW */
                sb->s_flags &= ~MS_RDONLY;
                if (sb_any_quota_suspended(sb)) {