Re: [PATCH 09/31] IGET: Stop BFS from using iget() and read_inode() [try #3]

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

 



Roel Kluin <12o3l@xxxxxxxxxx> wrote:

> > +	if (IS_ERR(inode))
> > +		return ERR_PTR(-ENOMEM);
> > +	if (!(inode->i_state & I_NEW))
> > +		return inode;
> 
> Don't you have to unlock_new_inode(inode) before returning?

In the first case, no because an OOM error was returned rather than an inode,
and in the second case, no because an extant non-locked inode was returned.

The inode is only returned locked by iget_locked() if it is also new - in
which case we don't return in either of the above two statements.

> > +error:
> 
> and also here?
> 
> > +	iget_failed(inode);
> > +	return ERR_PTR(-EIO);

Take a look at what iget_failed() does (patch #3):

	void iget_failed(struct inode *inode)
	{
		make_bad_inode(inode);
		unlock_new_inode(inode);
		iput(inode);
	}

David
-
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