Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bab53a17 authored by Sheng Yong's avatar Sheng Yong Committed by Jaegeuk Kim
Browse files

f2fs: quota: do not mount as RDWR without QUOTA if quota feature enabled



If quota feature is enabled, quota is on by default. However, if
CONFIG_QUOTA is not built in kernel, dquot entries will not get updated,
which leads to quota inconsistency.

Signed-off-by: default avatarSheng Yong <shengyong1@huawei.com>
Reviewed-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 3675f13c
Loading
Loading
Loading
Loading
+7 −6
Original line number Original line Diff line number Diff line
@@ -346,12 +346,6 @@ static int f2fs_check_quota_options(struct f2fs_sb_info *sbi)
			"QUOTA feature is enabled, so ignore jquota_fmt");
			"QUOTA feature is enabled, so ignore jquota_fmt");
		F2FS_OPTION(sbi).s_jquota_fmt = 0;
		F2FS_OPTION(sbi).s_jquota_fmt = 0;
	}
	}
	if (f2fs_sb_has_quota_ino(sbi->sb) && f2fs_readonly(sbi->sb)) {
		f2fs_msg(sbi->sb, KERN_INFO,
			 "Filesystem with quota feature cannot be mounted RDWR "
			 "without CONFIG_QUOTA");
		return -1;
	}
	return 0;
	return 0;
}
}
#endif
#endif
@@ -774,6 +768,13 @@ static int parse_options(struct super_block *sb, char *options)
#ifdef CONFIG_QUOTA
#ifdef CONFIG_QUOTA
	if (f2fs_check_quota_options(sbi))
	if (f2fs_check_quota_options(sbi))
		return -EINVAL;
		return -EINVAL;
#else
	if (f2fs_sb_has_quota_ino(sbi->sb) && !f2fs_readonly(sbi->sb)) {
		f2fs_msg(sbi->sb, KERN_INFO,
			 "Filesystem with quota feature cannot be mounted RDWR "
			 "without CONFIG_QUOTA");
		return -EINVAL;
	}
#endif
#endif


	if (F2FS_IO_SIZE_BITS(sbi) && !test_opt(sbi, LFS)) {
	if (F2FS_IO_SIZE_BITS(sbi) && !test_opt(sbi, LFS)) {