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?

Signed-off-by: Yunlei He <heyun...@huawei.com>
---
 fs/f2fs/super.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 25863cec..a0264a5 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -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;
-- 
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
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to