[PATCH] Journalled quota

From: Jan Kara
Date: Sun Feb 08 2004 - 11:34:33 EST



Hello,

I've finally written and reasonably debugged (= I haven't seen any
problem/inconsistency in ~40 test runs) journalled quota patch. The patch
implements quota journalling for ext3. What the patch basically does is that
all quota writes are journalled in the same transaction as an update of changed
inode so quota information should always stay consistent with a real usage
(i.e. no quotacheck needed). The patch also handles a case of orphan cleanup in
ext3 by turning quotas on before cleanup is started and quotas are turned off
after the cleanup is finished. This requires some tricks because quota code
needs to open a file in a not-yet mounted filesystem but hopefully I managed to
implement it in a clean way.
To test journalled quota you need to apply attached patch (also available at
ftp://atrey.karlin.mff.cuni.cz/pub/local/jack/quota/v2.6/quota-2.6.1-1-jquota.diff.gz)
to 2.6.1 kernel (I'll rediff it against newer one soon - the patch contains some
ext3 fixes which are included in newer kernels and so it won't probably apply to
a newer kernel). Compile the kernel and run it. To use journalled quota you need
to mount a filesystem with following options:
usrjquota=<user quota file>
grpjquota=<group quota file)
(quota files must be placed in filesystem's root directory)
jqfmt=vfsv0
(quota format 'vfsold' should also work but it's not tested)

You should not need any special quota-tools, just reasonably recent should be
enough. But to convince tools (especially quotaon(8)) to operate on the
filesystem you need to mount filesystem also with 'usrquota,grpquota' options
(I'll update the tools to recognize also the jquota options but for now...).
Also note that due to some bugs in quotacheck(8) the usage counted by
quotacheck won't probably match the usage counted by kernel - this is already
fixed in quota-tools CVS on sf.net and I expect I'll release the tools next
week.
Thanks in advance for testing, bugreports, etc.. :)

Honza
--
Jan Kara <jack@xxxxxxx>
SuSE CR Labs

Attachment: quota-2.6.1-1-jquota.diff.gz
Description: Binary data