ext4: return 32/64-bit dir name hash according to usage type
authorFan Yong <yong.fan@whamcloud.com>
Mon, 19 Mar 2012 02:44:40 +0000 (22:44 -0400)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 28 Nov 2013 14:01:58 +0000 (14:01 +0000)
commit72b749f64fc5550e3fb0f3c72868011737ef235c
tree2513320b08132464b797b5a8be870c89569252e9
parentf3576bd5915b9bd55886b6d92603ae6f2d3adb2d
ext4: return 32/64-bit dir name hash according to usage type

commit d1f5273e9adb40724a85272f248f210dc4ce919a upstream.

Traditionally ext2/3/4 has returned a 32-bit hash value from llseek()
to appease NFSv2, which can only handle a 32-bit cookie for seekdir()
and telldir().  However, this causes problems if there are 32-bit hash
collisions, since the NFSv2 server can get stuck resending the same
entries from the directory repeatedly.

Allow ext4 to return a full 64-bit hash (both major and minor) for
telldir to decrease the chance of hash collisions.  This still needs
integration on the NFS side.

Patch-updated-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
(blame me if something is not correct)

Signed-off-by: Fan Yong <yong.fan@whamcloud.com>
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/ext4/dir.c
fs/ext4/ext4.h
fs/ext4/hash.c