login
Header Space

 
 

Re: [PATCH/RFC 1/2] anon-inodes: Remove fd_install() from anon_inode_getfd()

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Roland Dreier <rdreier@...>
Cc: Christoph Hellwig <hch@...>, <linux-fsdevel@...>, Linux Kernel Mailing List <linux-kernel@...>, Avi Kivity <avi@...>, <kvm-devel@...>, Andrew Morton <akpm@...>, Al Viro <viro@...>
Date: Thursday, February 28, 2008 - 4:04 pm

On Wed, 27 Feb 2008, Roland Dreier wrote:


If we let the caller call fd_install(), then it may be messed up WRT 
cleanup (fd, file, inode).
How about removing the inode pointer handout altogether, and *doing* 
fd_install() inside anon_inode_getfd() like:

	if (pfile != NULL) {
		get_file(file);
		*pfile = file;
	}
	fd_install(fd, file);

In this way, if the caller want the file* back, he gets the reference 
bumped before fd_install().



- Davide


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH/RFC 1/2] anon-inodes: Remove fd_install() from an..., Christoph Hellwig, (Thu Mar 6, 11:14 am)
Re: [PATCH/RFC 1/2] anon-inodes: Remove fd_install() from an..., Christoph Hellwig, (Mon Mar 17, 6:40 am)
Re: [PATCH/RFC 1/2] anon-inodes: Remove fd_install() from an..., Davide Libenzi, (Thu Feb 28, 4:04 pm)
speck-geostationary