linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Theodore Ts'o <tytso@mit.edu>
Cc: Jan Kara <jack@suse.cz>,
	Ext4 Developers List <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH -v3] ext4: move quota initialization out of inode allocation transaction
Date: Fri, 19 Apr 2013 21:21:49 +0200	[thread overview]
Message-ID: <20130419192149.GA30218@quack.suse.cz> (raw)
In-Reply-To: <20130419162453.GA20513@thunk.org>

On Fri 19-04-13 12:24:53, Ted Tso wrote:
> On Fri, Apr 19, 2013 at 04:30:28PM +0200, Jan Kara wrote:
> > > +	inode->i_flags |= S_NOQUOTA;
> > > +	dquot_drop(inode);
> >   The above two lines have to be swapped to preserve original ordering
> > which is actually important. Thanks.
> > 
> > >  	iput(inode);
> 
> OK.  I'm confused --- what is the function of the S_NOQUOTA flag here?
> I thought it was dquot_drop() which needed this magic flag set.  I can
> swap these two lines, but maybe we should add a comment somewhere
> about why this flag is needed and what the heck it's doing?  At this
> point, the use of this flag seems like total magic to me.  :-(
  S_NOQUOTA flag means for quota code: Don't touch this inode, don't
account this inode or it's blocks. So in the file creation path we are
setting it when we bail out before inode is actually accounted in quota
(so that we don't decrease used inode count when freeing the inode
without incrementing it). To make things simple, we also set the flag when
the inode was already accounted for, but we handle the quota cleanup
ourselves (see fail_free_drop label).

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

  reply	other threads:[~2013-04-19 19:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-09  8:34 [PATCH 1/2] ext4: Improve credit estimate for EXT4_SINGLEDATA_TRANS_BLOCKS Jan Kara
2013-04-09  8:34 ` [PATCH 2/2] ext4: Move quota initialization out of inode allocation transaction Jan Kara
2013-04-09 16:42   ` Theodore Ts'o
2013-04-18 19:07     ` Theodore Ts'o
2013-04-18 21:46       ` Jan Kara
2013-04-18 23:24         ` [PATCH -v3] ext4: move " Theodore Ts'o
2013-04-19 14:30           ` Jan Kara
2013-04-19 16:24             ` Theodore Ts'o
2013-04-19 19:21               ` Jan Kara [this message]
2013-04-09 16:42 ` [PATCH 1/2] ext4: Improve credit estimate for EXT4_SINGLEDATA_TRANS_BLOCKS Theodore Ts'o

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=20130419192149.GA30218@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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).