f2fs: fix to restrict mount condition when without CONFIG_QUOTA
Chao Yu
maintainerPATCH RESEND 1/1 f2fs: fix to restrict mount condition when without CONFIG_QUOTA
From: Chao Yu <[email protected]>
Like quota_ino feature, we need to reject mounting RDWR with image which enables project_quota feature when there is no CONFIG_QUOTA be set in kernel.
--- fs/f2fs/super.c | 6 ++++++ 1 file changed, 6 insertions(+)
fs/f2fs/super.c +6 -0
@@ -775,6 +775,12 @@ static int parse_options(struct super_block *sb, char *options) "without CONFIG_QUOTA"); return -EINVAL; } +if (f2fs_sb_has_project_quota (sbi->sb) && !f2fs_readonly (sbi->sb)) { +f2fs_msg (sb,KERN_ERR , +"Filesystem with project quota feature cannot be " +"mounted RDWR without CONFIG_QUOTA" ); +return -EINVAL ; + }#endif if (F2FS_IO_SIZE_BITS (sbi) && !test_opt (sbi,LFS )) {
Signature · 1 line
2.16.2.17.g38e79b1fd
Hi, Chao
Quoted 16 lines · Chao Yu
From: Chao Yu <[email protected]>
Like
quota_inofeature, we need to reject mounting RDWR with image which enablesproject_quotafeature when there is noCONFIG_QUOTAbe set in kernel.Signed-off-by Chao Yu <[email protected]>--- fs/f2fs/super.c | 6 ++++++ 1 file changed, 6 insertions(+)fs/f2fs/super.c +0
-0
fs/f2fs/super.c static int parse_options(struct super_block *sb, char *options) · line 777
Quoted 3 lines
fs/f2fs/super.c +0
-0@@ -775,6 +775,12 @@ static int parse_options(struct super_block *sb, char *options) "without CONFIG_QUOTA");return -EINVAL ; }
I think the following should be checked within !CONFIG_QUOTA, like patch "f2fs: quota: do not mount as RDWR without QUOTA if quota feature enabled" :)
thanks
fs/f2fs/super.c static int parse_options(struct super_block *sb, char *options) · line 786
Quoted 10 lines
fs/f2fs/super.c +6
-0+if (f2fs_sb_has_project_quota (sbi->sb) && !f2fs_readonly (sbi->sb)) { +f2fs_msg (sb,KERN_ERR , +"Filesystem with project quota feature cannot be " +"mounted RDWR without CONFIG_QUOTA" ); +return -EINVAL ; + }#endif if (F2FS_IO_SIZE_BITS (sbi) && !test_opt (sbi,LFS )) {
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Quoted 14 lines · Sheng Yong
Hi, Chao
Quoted 11 lines · Chao Yu
From: Chao Yu <[email protected]>
Like
quota_inofeature, we need to reject mounting RDWR with image which enablesproject_quotafeature when there is noCONFIG_QUOTAbe set in kernel.Signed-off-by Chao Yu <[email protected]>--- fs/f2fs/super.c | 6 ++++++ 1 file changed, 6 insertions(+)
Quoted 11 lines
fs/f2fs/super.c static int parse_options(struct super_block *sb, char *options) · line 777
Quoted 8 lines
fs/f2fs/super.c +0
-0@@ -775,6 +775,12 @@ static int parse_options(struct super_block *sb, char *options) "without CONFIG_QUOTA");return -EINVAL ; }I think the following should be checked within !CONFIG_QUOTA, like patch "f2fs: quota: do not mount as RDWR without QUOTA if quota feature enabled" :)
I wrote this patch based on yours, so I think the code actually locates in the right place. Please check serials on below link:
https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git/log/?h=f2fs-dev
Quoted 17 lines
thanks
fs/f2fs/super.c static int parse_options(struct super_block *sb, char *options) · line 786
Quoted 10 lines
fs/f2fs/super.c +6
-0+if (f2fs_sb_has_project_quota (sbi->sb) && !f2fs_readonly (sbi->sb)) { +f2fs_msg (sb,KERN_ERR , +"Filesystem with project quota feature cannot be " +"mounted RDWR without CONFIG_QUOTA" ); +return -EINVAL ; + }#endif if (F2FS_IO_SIZE_BITS (sbi) && !test_opt (sbi,LFS )) {.