Thread (8 messages) 8 messages, 5 authors, 2016-07-11

Re: [PATCH] ext4: add project quota mount options

From: Jan Kara <jack@suse.cz>
Date: 2016-07-11 15:29:43

On Thu 07-07-16 23:10:02, Ted Tso wrote:
On Thu, Jul 07, 2016 at 11:06:10AM -0500, Eric Sandeen wrote:
quoted
quoted
add prjquota, prjjquota, offprjjquota mount options
for project quota.

These kind of mount options are used for old
quota design, and we can use quotas like these
way:

 # mkfs.ext4 /dev/sda
 # mount /dev/sda -o prjquota /mnt/test
 # quotacheck -p /mnt/test
 # quotaon /mnt/test

This new mount options are also useful to unify
some generic tests for xfs and ext4.
I think we want to really think about whether we want to support this
mode.  Right now we have so *many* different permutations of quota
that it's a whole lot more than "old" vs "new".  We have different
versions of the quota files, "journaled quota", "first class quota"
(where the quota files are hidden), etc.

For user quota and project quota, we do need to support the older
quota systems, where usrquota and grpquota are in fact no-ops as far
as the kernel is concerned, and are only used as a signal to some init
files so they know how to run quotacheck and to the quotatools
userspace tools, and where quotaon is used to pass the quota files to
the file system using the quotactl system call.

Then there is the "journalled quota" system, where filenames are
passed via the mount options usrjquota= and grpjquota= and where quota
updates are done using data journal mode.  In this mode, at least in
theory, you don't need to run quotacheck, so the fact that usrquota
and grpquota mount options aren't present don't matter as far as the
init scripts are concerned.  (Although if they get corrupted, good
luck to you.)
When you use "journalled quota" mode, you still need to run quotacheck
after e2fsck fixes anything or when quota files get corrupted due to bugs,
HW errors, etc. Also quotaon(8) still uses mount options to determine on
which filesystems it should turn on quotas in this mode.
With both of the above systems, there are three possible quota
formats: old, v0, and v1.  I never remember the details of the
differences between them, but IIRC there are differences in terms of
the width (e.g., number of bits) used for the uids, gids, and number
of blocks and files.
This is correct.
OK, so if you look at the above, the test matrix is at six: journaled
vs. non-journaled quota files, old vs v0 vs v1.  And this doesn't take
into account whether or not project quota is enabled or not.  I propose
that we ***not*** support any of this for project quota.

The mode that I *do* suggest supporting for project quota for ext4
requires that you create a file system using -O quota, which enables
"internal quotas", which is sometimes also referred to as "first class
quotas".  In this mode, the quota files become hidden files so
userspace can't screw them up or otherwise corrupt them.  The quota
files are journalled, and are checked and consistency corrected by
e2fsck.  This is *much* faster than having quotacheck do a separate
user-space walk of the entire file system, which is slow, and subject
to files being hidden underneath mountpoints, etc., etc.
Completely agreed. Old modes of operation for project quota were actually
originally implemented but we never merged that code exactly because we
didn't find legacy mode of operation useful for project quotas.

								Honza
-- 
Jan Kara [off-list ref]
SUSE Labs, CR
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help