f2fs: fix to restrict mount condition when without CONFIG_QUOTA
authorChao Yu <yuchao0@huawei.com>
Wed, 25 Jul 2018 23:19:48 +0000 (07:19 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 1 Aug 2018 18:52:36 +0000 (11:52 -0700)
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.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/super.c

index d10c9a57a15d10eff7dd740c8499df2a78b27f7e..449b09498ddbc0151a56a174484bbb92155b4fc9 100644 (file)
@@ -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)) {