lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080715031202.GB4624@skywalker>
Date:	Tue, 15 Jul 2008 08:42:02 +0530
From:	"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>
To:	Mingming Cao <cmm@...ibm.com>
Cc:	Theodore Tso <tytso@....edu>,
	linux-ext4 <linux-ext4@...r.kernel.org>
Subject: Re: [PATCH] Ext4: Fix delalloc enospace handling counter update
	race

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@...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@...ibm.com>
> > 
> > Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@...ux.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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ