linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: Carlos Carvalho <carlos@fisica.ufpr.br>
Cc: linux-ext4@vger.kernel.org, adityakali@google.com, jack@suse.cz
Subject: Re: how to quotacheck with the new quota implementation (hidden inode)?
Date: Mon, 21 Jan 2013 00:47:41 -0500	[thread overview]
Message-ID: <20130121054741.GB321@thunk.org> (raw)
In-Reply-To: <20730.1955.395545.141779@fisica.ufpr.br>

On Sat, Jan 19, 2013 at 12:40:35AM -0200, Carlos Carvalho wrote:
> I've started to use the new quota implementation (3.7.3 running now).
> I used tune2fs -Q to turn non {usr,grp}quota. It's nice, no need to
> run quotaon and all the jquota=file options. It works but it starts
> counting only what comes after the mount with the new quota. If there
> is already stuff in the filesystem it's not counted. How can we do a
> quotacheck?

tune2fs -Q should have set up the quota inodes with the correct usage
information.  What version of e2fsprogs were you using?  If the quota
information is incorrect, e2fsck will correct it --- so e2fsck will
serve as the quota check.

That being said, I've been doing some testing, and I have found some
shortcomings with the e2fsck's handling of the quota option that we
need to fix before I can recommend people use the new quota
implementation.

1) The e2fsck check of the on-disk quota inodes won't notice if there
is a missing uid record.  (i.e., if some uid, say daemon owns a bunch
of files, but that uid record is not in the quota inode, e2fsck won't
say boo.)

2) If e2fsck *does* notice a discrepancy between the usage information
recorded in the hidden quota inodes, and the actual number of blocks
used by a particular user id or group id, it will overwrite the user
or group quota inode with all of the information it has.
Unfortunately, in the process it will zero out all of the current
quota limits set.   This is unfortunate....

I've also found two kernel bugs.  If the quota code is built as a
kernel module, and the quota_v2 module is not loaded, and the file
system has a hidden quota module, currently the kernel (a) won't
request that the quota_v2 module be loaded, since the array which
control the module loading only know about QFMT_VFS_OLD and
QFMT_VFS_V0, but not QFMT_VFS_CV1, and then (b)it will return a
mysterious error, "No such process" (ESRCH) without printing any kind
of explanatory printk message, and then fail to delete the
/sys/fs/ext4/<dev> kobject, which will cause future attempts to load
that device to fail and to trigger a sysfs WARN_ON when ext4 tries to
create the /sys/fs/ext4/<dev> object, and sysfs discovers that the old
one still exists.

I'll send patches for the kernel bugs, but that still leaves some
additional work that needs to be done before I'd be ready to call the
quota feature fully ready for prime time....

> Also, what happens if the machine crashes without umounting? How is
> the usage going to be handled? Is it in the journal? Anyway, it'd also
> be important to do a quotacheck.

The quota updates are all journalled, so that's all OK.  And if they
aren't correct, e2fsck will correct them, although as mentioned above,
there are some cases when e2fsck might not notice a problem (a bug)
and when it does try to correct them, it will blow away all of the
stored quota limits in the quota inode (another bug).  Also, we're
still missing repquota functionality for ocfs2 and ext4 with the
hidden inode feature --- this requires a new quotactl kernel interface
to support iterating over the uid/gid values in the dquot tree, and
userspace support in the quotatools package.

						- Ted

  reply	other threads:[~2013-01-21  5:47 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-19  2:40 how to quotacheck with the new quota implementation (hidden inode)? Carlos Carvalho
2013-01-21  5:47 ` Theodore Ts'o [this message]
2013-01-21  6:46   ` [PATCH 1/2] ext4: release sysfs kobject when failing to enable quotas on mount Theodore Ts'o
2013-01-21  6:46     ` [PATCH 2/2] quota: autoload the quota_v2 module for QFMT_VFS_V1 quota format Theodore Ts'o
2013-01-21 10:40       ` Jan Kara
2013-01-21 15:01         ` Theodore Ts'o
2013-01-21 15:10           ` Jan Kara
2013-01-21 15:50             ` Theodore Ts'o
2013-01-21 19:08               ` Jan Kara
2013-01-21 12:16       ` Carlos Maiolino
2013-01-21 12:12     ` [PATCH 1/2] ext4: release sysfs kobject when failing to enable quotas on mount Carlos Maiolino
2013-01-21 17:26   ` how to quotacheck with the new quota implementation (hidden inode)? Carlos Carvalho
2013-01-21 19:34   ` Aditya Kali
2013-01-31 19:01   ` Carlos Carvalho
2013-01-31 19:04     ` Aditya Kali
2013-01-31 19:13       ` Carlos Carvalho
2013-01-31 22:03         ` Theodore Ts'o
2013-01-31 22:28           ` Jan Kara
2013-01-31 22:44             ` Carlos Carvalho
2013-01-31 23:03             ` Theodore Ts'o
2013-02-04  9:42               ` Jan Kara
2013-01-31 22:41           ` Carlos Carvalho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130121054741.GB321@thunk.org \
    --to=tytso@mit.edu \
    --cc=adityakali@google.com \
    --cc=carlos@fisica.ufpr.br \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).