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] [day] [month] [year] [list]
Message-ID: <30783.1192088380@redhat.com>
Date:	Thu, 11 Oct 2007 08:39:40 +0100
From:	David Howells <dhowells@...hat.com>
To:	Roel Kluin <12o3l@...cali.nl>
Cc:	dhowells@...hat.com, hch@...radead.org, viro@....linux.org.uk,
	torvalds@...l.org, akpm@...l.org, linux-kernel@...r.kernel.org,
	linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH 09/31] IGET: Stop BFS from using iget() and read_inode() [try #3]

Roel Kluin <12o3l@...cali.nl> 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-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