Re: [PATCH 3/4] Adds project quota support for ext4
From: Li Xi <hidden>
Date: 2014-09-25 01:28:24
Also in:
linux-api, linux-fsdevel
On Thu, Sep 25, 2014 at 1:31 AM, Jan Kara [off-list ref] wrote:
On Wed 24-09-14 22:04:29, Li Xi wrote:quoted
This patch adds mount options for enabling/disabling project quota accounting and enforcement. A new specific inode is also used for project quota accounting.The patch looks mostly fine. A few smaller things below. ...quoted
@@ -1433,6 +1437,8 @@ static const struct mount_opts { MOPT_SET | MOPT_Q}, {Opt_grpquota, EXT4_MOUNT_QUOTA | EXT4_MOUNT_GRPQUOTA, MOPT_SET | MOPT_Q}, + {Opt_prjquota, EXT4_MOUNT_QUOTA | EXT4_MOUNT_PRJQUOTA, + MOPT_SET | MOPT_Q}, {Opt_noquota, (EXT4_MOUNT_QUOTA | EXT4_MOUNT_USRQUOTA | EXT4_MOUNT_GRPQUOTA), MOPT_CLEAR | MOPT_Q},I think you missed to add EXT4_MOUNT_PRJQUOTA to Opt_noquota... ...quoted
@@ -2833,6 +2855,13 @@ static int ext4_feature_set_ok(struct super_block *sb, int readonly) "without CONFIG_QUOTA"); return 0; } + if (EXT4_HAS_RO_COMPAT_FEATURE(sb, EXT4_FEATURE_RO_COMPAT_PROJECT) && + !readonly) { + ext4_msg(sb, KERN_ERR, + "Filesystem with project quota feature cannot be" + "mounted RDWR without CONFIG_QUOTA"); + return 0; + }Hum, I don't think this is right. EXT4_FEATURE_RO_COMPAT_PROJECT is about maintaining project IDs not about quota. So it seems perfectly OK to have EXT4_FEATURE_RO_COMPAT_PROJECT without CONFIG_QUOTA.
Ah, I see. This might be my main misunderstanding. I thought it is about maintaining both project IDs and quota. And I misunderstood so that I removed all EXT4_FEATURE_RO_COMPAT_PROJECT checking when set/get project ID. If we only use EXT4_FEATURE_RO_COMPAT_PROJECT to protect imcompatibility of project ID, what about the change of struct ext4_super_block? I am still confused. Please advise. Regards, Li Xi