linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Dmitry Monakhov <dmonakhov@openvz.org>
Cc: Jan Kara <jack@suse.cz>, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] quota: add per-inode reservaton space sanity checks.
Date: Wed, 31 Mar 2010 16:29:41 +0200	[thread overview]
Message-ID: <20100331142940.GA3322@quack.suse.cz> (raw)
In-Reply-To: <87aatpcbji.fsf@openvz.org>

On Wed 31-03-10 09:20:17, Dmitry Monakhov wrote:
> dmonakhov@openvz.org writes:
> 
> > Jan Kara <jack@suse.cz> writes:
> >
> >> On Tue 30-03-10 18:25:28, Dmitry Monakhov wrote:
> >>> We already has per-dquot sanity checks, but with per-inode checks
> >>> quota leakage investigation becomes much easier.
> >>> 
> >>> Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
> >>> ---
> >>>  fs/quota/dquot.c |    4 ++++
> >>>  1 files changed, 4 insertions(+), 0 deletions(-)
> >>> 
> >>> diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
> >>> index e0b870f..4db57b7 100644
> >>> --- a/fs/quota/dquot.c
> >>> +++ b/fs/quota/dquot.c
> >>> @@ -1428,6 +1428,8 @@ EXPORT_SYMBOL(inode_add_rsv_space);
> >>>  void inode_claim_rsv_space(struct inode *inode, qsize_t number)
> >>>  {
> >>>  	spin_lock(&inode->i_lock);
> >>> +	if (*inode_reserved_space(inode) < number)
> >>> +		WARN_ON_ONCE(1);
> >>   Maybe just: WARN_ON_ONCE(*inode_reserved_space(inode) < number)
> Ohh. While writing testcase for automatic-quota consistency check.
> I've failed to reliably detect condition where quota goes inconsistent.
> And it appears to be not what easy. We have hided real problems too deeply.
> The only reliable way is to grep dmesg for hard-coded "fs/quota/dquot.c"
> string which produced by WARN_ON_ONCE.
> 
> After some thoughts (sometimes it happens with me too)
> i'm think what it is reasonable rewrite all quota error messages logic.
> Make it similar to ext4
> quota_error(...) {
>    printk("QUOTA error (dev:%s)", ...);
>    handle_quota_error(sb) /* let sb to know what quota is corrupted */
> }
> quota_warn(...) {
>    printk("QUOTA warn (dev:%s)", ...);
> }
> In fact it is very important to let filesystem to now that it's quota
> is corrupted(quota == fs-metadata). It may set fsck_needed flag on
> super block for later correction.
  Yes, it looks like a good idea.

> So please ignore this patch for now. I'll prepare another one which
> redesign error conditions handling logic.
  OK.

								Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

      parent reply	other threads:[~2010-03-31 14:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-30 14:25 [PATCH] quota: add per-inode reservaton space sanity checks Dmitry Monakhov
2010-03-30 15:39 ` Jan Kara
2010-03-30 16:20   ` dmonakhov
2010-03-31  5:20     ` Dmitry Monakhov
2010-03-31  6:55       ` Dave Chinner
2010-03-31  7:17         ` dmonakhov
2010-03-31 23:23           ` Dave Chinner
2010-03-31 14:29       ` Jan Kara [this message]

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=20100331142940.GA3322@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=dmonakhov@openvz.org \
    --cc=linux-fsdevel@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).