Skip to contentSkip to conversation

f2fs: fix to restrict mount condition when without CONFIG_QUOTA

PATCH Superseded Chao Yu 3 participants 3 messages Jul 24, 2018 – Jul 27, 2018 F2FS file system

lore
Share & tools
lore

Chao Yu

author maintainer
#0 lore raw

PATCH 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
index dbc1cb53581f..bb40f08d2861 100644
@@ -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)) {
+		ext4_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
maintainer
#1 lore raw
Quoted 16 lines · Chao Yu

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 +0 -0
index dbc1cb53581f..bb40f08d2861 100644

fs/f2fs/super.c static int parse_options(struct super_block *sb, char *options) · line 779

Quoted 5 lines
fs/f2fs/super.c +2 -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)) {
+		ext4_msg(sb, KERN_ERR,

What is this?

Quoted 9 lines
fs/f2fs/super.c +4 -0
+			"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
#2 lore raw
Quoted 12 lines · Jaegeuk Kim
Quoted 11 lines · Chao Yu

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(+)
Quoted 12 lines

fs/f2fs/super.c static int parse_options(struct super_block *sb, char *options) · line 779

Quoted 10 lines
fs/f2fs/super.c +2 -0
index dbc1cb53581f..bb40f08d2861 100644
@@ -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)) {
+		ext4_msg(sb, KERN_ERR,

What is this?

Sorry, I just porting ext4's code here, but forget to change the function, strangely, it pass my module compiling... :(, I have resend one patch.

Thanks,

Quoted 13 lines
Quoted 10 lines
fs/f2fs/super.c +4 -0
+			"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

.