Re: [PATCH] pipefs unique inode numbers

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Bodo Eggert <7eggert@...>
Cc: <akpm@...>, Jeff Layton <jlayton@...>, <dev@...>, <linux-kernel@...>, <linux-fsdevel@...>, <torvalds@...>
Date: Tuesday, January 30, 2007 - 9:19 pm

Bodo Eggert wrote:
 > change pipefs to use a unique inode number equal to the memory
 > address unless it would be truncated.
 >
 > Signed-Off-By: Bodo Eggert <7eggert@gmx.de>
 > ---
 > Tested on i386.
 >
 > --- 2.6.19/fs/pipe.c.ori	2007-01-30 22:02:46.000000000 +0100
 > +++ 2.6.19/fs/pipe.c	2007-01-30 23:22:27.000000000 +0100
 > @@ -864,6 +864,10 @@ static struct inode * get_pipe_inode(voi
 >  	inode->i_uid = current->fsuid;
 >  	inode->i_gid = current->fsgid;
 >  	inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
 > +	/* The address of *inode is unique, so we'll get an unique inode number.
 > +	 * Off cause this will not work for 32 bit inodes on 64 bit systems. */
 > +	if (sizeof(inode->i_ino) >= sizeof(struct inode*))
 > +		inode->i_ino = (unsigned int) inode;
 >
 >  	return inode;
 >

Also, that patch would break many 32-bit programs not compiled with large
offsets when run in compatibility mode on a 64-bit kernel. If they were to
do a stat on this inode, it would likely generate an EOVERFLOW error since
the pointer address would probably not fit in a 32 bit field.

That problem was the whole impetus for this set of patches.

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

Messages in current thread:
[PATCH] pipefs unique inode numbers, Bodo Eggert, (Tue Jan 30, 6:40 pm)
Re: [PATCH] pipefs unique inode numbers, Jeff Layton, (Tue Jan 30, 9:19 pm)
Re: [PATCH] pipefs unique inode numbers, Jeff Layton, (Tue Jan 30, 9:37 pm)
Re: [PATCH] pipefs unique inode numbers, Linus Torvalds, (Tue Jan 30, 9:28 pm)
Re: [PATCH] pipefs unique inode numbers, Kirill Korotaev, (Wed Jan 31, 5:19 am)
Re: [PATCH] pipefs unique inode numbers, Jeff Layton, (Tue Jan 30, 10:02 pm)
Re: [PATCH] pipefs unique inode numbers, Linus Torvalds, (Tue Jan 30, 6:55 pm)
Re: [PATCH] pipefs unique inode numbers, Jeff Layton, (Tue Jan 30, 8:12 pm)