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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20101016075421.GB19147@amd>
Date:	Sat, 16 Oct 2010 18:54:21 +1100
From:	Nick Piggin <npiggin@...nel.dk>
To:	Christoph Hellwig <hch@...radead.org>
Cc:	Dave Chinner <david@...morbit.com>, linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 04/17] fs: icache lock i_state

On Fri, Oct 01, 2010 at 01:54:33AM -0400, Christoph Hellwig wrote:
> > +		spin_lock(&inode->i_lock);
> > +		if (inode->i_state & (I_FREEING|I_WILL_FREE|I_NEW)
> > +				|| inode->i_mapping->nrpages == 0) {
> 
> 
> This is some pretty strange formatting.
> 
> 		if ((inode->i_state & (I_FREEING|I_WILL_FREE|I_NEW)) ||
> 		    inode->i_mapping->nrpages == 0) {
> 
> would be more standard.
> 
> >  	list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
> >  		struct address_space *mapping;
> >  
> > -		if (inode->i_state & (I_FREEING|I_WILL_FREE|I_NEW))
> > -			continue;
> >  		mapping = inode->i_mapping;
> >  		if (mapping->nrpages == 0)
> >  			continue;
> > +		spin_lock(&inode->i_lock);
> > +		if (inode->i_state & (I_FREEING|I_WILL_FREE|I_NEW)) {
> > +			spin_unlock(&inode->i_lock);
> > +			continue;
> > +		}
> 
> Can we access the mapping safely when the inode isn't actually fully
> setup?  Even if we can I'd rather not introduce this change hidden
> inside an unrelated patch.

Good point, fixed.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ