ocfs2: Enable quota accounting on mount, disable on umount
PATCH 1/1 ocfs2: Enable quota accounting on mount, disable on umount
Enable quota usage tracking on mount and disable it on umount. Also add support for quota on and quota off quotactls and usrquota and grpquota mount options.
--- fs/ocfs2/ocfs2.h | 2 + fs/ocfs2/super.c | 191 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 193 insertions(+), 0 deletions(-)
fs/ocfs2/ocfs2.h +2 -0
@@ -184,6 +184,8 @@ enum ocfs2_mount_optionsOCFS2_MOUNT_ERRORS_PANIC =1 <<3 ,/* Panic on errors */ OCFS2_MOUNT_DATA_WRITEBACK =1 <<4 ,/* No data ordering */ OCFS2_MOUNT_LOCALFLOCKS =1 <<5 ,/* No cluster aware user file locks */ +OCFS2_MOUNT_USRQUOTA =1 <<6 ,/* We support user quotas */ + OCFS2_MOUNT_GRPQUOTA = 1 << 7, /* We support group quotas */ };#define OCFS2_OSB_SOFT_RO 0x0001
fs/ocfs2/super.c +191 -0
269 lines not on this page · raw message
Signature · 1 line
1.5.2.4
PATCH 1/1 ocfs2: Enable quota accounting on mount, disable on umount
Quoted 6 lines · Jan Kara
Enable quota usage tracking on mount and disable it on umount. Also add support for quota on and quota off quotactls and usrquota and grpquota mount options.
Signed-off-by Jan Kara <[email protected]>---
Looks good, with one small comment.
fs/ocfs2/super.c static int ocfs2_fill_super(struct super_block *sb, void *data, int silent) · line 806
Quoted 10 lines
fs/ocfs2/super.c +6
-0@@ -660,6 +798,22 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent) osb->preferred_slot = parsed_options.slot; osb->osb_commit_interval = parsed_options.commit_interval; osb->local_alloc_size = parsed_options.localalloc_opt; +if (osb->s_mount_opt &OCFS2_MOUNT_USRQUOTA && + !OCFS2_HAS_RO_COMPAT_FEATURE (sb, +OCFS2_FEATURE_RO_COMPAT_USRQUOTA )) { + status = -EINVAL ; +mlog (ML_ERROR ,"User quota requested but filesystem feature " +"is not set\n" );
Can we say "User quotas were requested, but this filesystem does not
have the feature enabled.\n"? The same for group quotas.
Joel
Signature · 9 lines
"Nothing is wrong with California that a rise in the ocean level
wouldn't cure."
- Ross MacDonald
Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127PATCH 1/1 ocfs2: Enable quota accounting on mount, disable on umount
Quoted 10 lines · Joel Becker
Quoted 6 lines · Jan Kara
Enable quota usage tracking on mount and disable it on umount. Also add support for quota on and quota off quotactls and usrquota and grpquota mount options.
Signed-off-by Jan Kara <[email protected]>---
Looks good, with one small comment.
Quoted 13 lines
fs/ocfs2/super.c static int ocfs2_fill_super(struct super_block *sb, void *data, int silent) · line 806
Quoted 10 lines
fs/ocfs2/super.c +6
-0@@ -660,6 +798,22 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent) osb->preferred_slot = parsed_options.slot; osb->osb_commit_interval = parsed_options.commit_interval; osb->local_alloc_size = parsed_options.localalloc_opt; +if (osb->s_mount_opt &OCFS2_MOUNT_USRQUOTA && + !OCFS2_HAS_RO_COMPAT_FEATURE (sb, +OCFS2_FEATURE_RO_COMPAT_USRQUOTA )) { + status = -EINVAL ; +mlog (ML_ERROR ,"User quota requested but filesystem feature " +"is not set\n" );Can we say "User quotas were requested, but this filesystem does not
have the feature enabled.\n"? The same for group quotas.
Of course. I always take a language advice from a native speaker ;).
Done.
Honza
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR