Skip to contentSkip to conversation

f2fs: check mount option before turn quota on

PATCH In review Yunlei He 2 participants 2 messages Jun 6, 2018 F2FS file system

lore
Share & tools
lore

Yunlei He

author
#0 lore raw

PATCH 1/1 f2fs: check mount option before turn quota on

This patch add a mount option check before turn quota on, which is same as ext4 does. BTW, both f2fs and ext4 have no mount options check to enable limits quota on sys file, is there no need to do this?

---
 fs/f2fs/super.c | 3 +++
 1 file changed, 3 insertions(+)
fs/f2fs/super.c +3 -0
index 25863cec..a0264a5 100644
@@ -1792,6 +1792,9 @@ static int f2fs_quota_on(struct super_block *sb, int type, int format_id,
 	struct inode *inode;
 	int err;
 
+	if (!test_opt(sb, QUOTA))
+		return -EINVAL;
+
 	err = f2fs_quota_sync(sb, type);
 	if (err)
 		return err;
Signature · 6 lines
1.9.1


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
#1 lore raw
Quoted 15 lines · Yunlei He

This patch add a mount option check before turn quota on, which is same as ext4 does. BTW, both f2fs and ext4 have no mount options check to enable limits quota on sys file, is there no need to do this?

---
 fs/f2fs/super.c | 3 +++
 1 file changed, 3 insertions(+)
fs/f2fs/super.c +0 -0
index 25863cec..a0264a5 100644

fs/f2fs/super.c static int f2fs_quota_on(struct super_block *sb, int type, int format_id, · line 1795

Quoted 4 lines
fs/f2fs/super.c +1 -0
@@ -1792,6 +1792,9 @@ static int f2fs_quota_on(struct super_block *sb, int type, int format_id,
 	struct inode *inode;
 	int err;
 
+	if (!test_opt(sb, QUOTA))

s/sb/F2FS_SB(sb)...

Anyway, this fails tests/generic/082, could you look into the issue.

Thanks,

fs/f2fs/super.c static int f2fs_quota_on(struct super_block *sb, int type, int format_id, · line 1800

Quoted 6 lines
fs/f2fs/super.c +2 -0
+		return -EINVAL;
+
 	err = f2fs_quota_sync(sb, type);
 	if (err)
 		return err;

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot