diff options
author | Eric Sandeen <sandeen@redhat.com> | 2012-04-26 13:10:39 -0500 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2013-11-28 14:01:59 +0000 |
commit | 3b712f1354a50e043f37583d5f31e013245d7825 (patch) | |
tree | a464bfdf9232233d2e6904ee09f23b384fab9d19 /include | |
parent | 7ddeebd9bb1f005226b818f58cd6b2eaadf7976c (diff) |
ext3: return 32/64-bit dir name hash according to usage type
commit d7dab39b6e16d5eea78ed3c705d2a2d0772b4f06 upstream.
This is based on commit d1f5273e9adb40724a85272f248f210dc4ce919a
ext4: return 32/64-bit dir name hash according to usage type
by Fan Yong <yong.fan@whamcloud.com>
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 ext3 to return a full 64-bit hash (both major and minor) for
telldir to decrease the chance of hash collisions.
This patch does implement a new ext3_dir_llseek op, because with 64-bit
hashes, nfs will attempt to seek to a hash "offset" which is much
larger than ext3's s_maxbytes. So for dx dirs, we call
generic_file_llseek_size() with the appropriate max hash value as the
maximum seekable size. Otherwise we just pass through to
generic_file_llseek().
Patch-updated-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
Patch-updated-by: Eric Sandeen <sandeen@redhat.com>
(blame us if something is not correct)
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/ext3_fs.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index dec99116a0e4..d59ab1265967 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h @@ -781,7 +781,11 @@ struct dx_hash_info u32 *seed; }; -#define EXT3_HTREE_EOF 0x7fffffff + +/* 32 and 64 bit signed EOF for dx directories */ +#define EXT3_HTREE_EOF_32BIT ((1UL << (32 - 1)) - 1) +#define EXT3_HTREE_EOF_64BIT ((1ULL << (64 - 1)) - 1) + /* * Control parameters used by ext3_htree_next_block |