Re: [PATCH 04/17] fs: icache lock i_state

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux