public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Mingming Cao <cmm@us.ibm.com>
Cc: Theodore Tso <tytso@mit.edu>, linux-ext4 <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH] Ext4: Fix delalloc enospace handling counter update race
Date: Tue, 15 Jul 2008 08:42:02 +0530	[thread overview]
Message-ID: <20080715031202.GB4624@skywalker> (raw)
In-Reply-To: <1216058076.6468.11.camel@mingming-laptop>

On Mon, Jul 14, 2008 at 10:54:36AM -0700, Mingming Cao wrote:
> 
> 在 2008-07-14一的 22:23 +0530,Aneesh Kumar K.V写道:
> > On Mon, Jul 14, 2008 at 09:28:17AM -0700, Mingming Cao wrote:
> > > 
> > > Ext4: Fix delalloc enospace handling counter update race
> > > 
> > > From: Mingming Cao <cmm@us.ibm.com>
> 
> > > Also in the case of truncate, we should not clear the per-allocation allocated
> > > metablocks counter as that may be in-use by parallel allocation. The patch
> > > only clear the per-allocation allocated metablocks when allocation is successfully returned.
> > > 
> > > 
> > > Signed-off-by: Mingming Cao <cmm@us.ibm.com>
> > 
> > Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> 
> 
> > > @@ -1519,7 +1529,8 @@ void ext4_da_release_space(struct inode 
> > > 
> > >  	BUG_ON(mdb > EXT4_I(inode)->i_reserved_meta_blocks);
> > >  	EXT4_I(inode)->i_reserved_meta_blocks = mdb;
> > > -	EXT4_I(inode)->i_allocated_meta_blocks = 0;
> > > +	if (used)
> > > +		EXT4_I(inode)->i_allocated_meta_blocks = 0;
> > >  	spin_unlock(&EXT4_I(inode)->i_block_reservation_lock);
> > >  }
> > > 
> 
> After think again, this part of race fix may not needed, when the first
> part of patch is applied. Since truncate is also hold the i_data_sem, so
> it could be assured that when truncate is releasing the page's  reserved
> blocks, there is no parallel block allocation.

But truncate calls invalidate_page without holding i_data_sem.

vmtruncate -> truncate_inode_pages -> invalidate_page.


-aneesh
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2008-07-15  3:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-13  6:26 [patch 4/4] ext4: replace __FUNCTION__ occurrences akpm
2008-07-14  1:08 ` Theodore Tso
2008-07-14 16:28   ` [PATCH] Ext4: Fix delalloc enospace handling counter update race Mingming Cao
2008-07-14 16:53     ` Aneesh Kumar K.V
2008-07-14 17:54       ` Mingming Cao
2008-07-14 18:05         ` Theodore Tso
2008-07-14 18:34           ` Mingming Cao
2008-07-15  3:12         ` Aneesh Kumar K.V [this message]
2008-07-15 21:12           ` Mingming Cao

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=20080715031202.GB4624@skywalker \
    --to=aneesh.kumar@linux.vnet.ibm.com \
    --cc=cmm@us.ibm.com \
    --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