Cc: J. Bruce Fields <bfields@...>, <xfs@...>, Adam Schrotenboer <adam@...>, Jesper Juhl <jesper.juhl@...>, Trond Myklebust <trond.myklebust@...>, <linux-kernel@...>, <linux-nfs@...>, Thomas Daniel <tdaniel@...>, Frederic Revenu <frevenu@...>, Jeff Doan <jdoan@...>
On Wed, March 26, 2008 9:13 am, Josef 'Jeff' Sipek wrote:
What we need is for the "filehandle" to be stable and unique.
By 'stable' I mean that every time I get the filehandle for a particular
file, I get the same string of bytes.
By 'uniqie' I mean that if I get two filehandles for two different
files, they must differ in at least one bit.
If a file is deleted and the inode is re-used for a new file, then the
old and new files are different and must have different file handles.
The filehandle is traditionally generated from the inode number and
a generation number, but the filesystem can actually do whatever it
likes. xfs does it with xfs_fs_encode_fh().
Certainly you could initialise the i_generation to jiffies in
xfs_ialloc_ag_alloc. That would be a suitable fix. get_random_bytes
might be better, but the difference probably wouldn't be noticeable.
NeilBrown
--