• E
    ext3: return 32/64-bit dir name hash according to usage type · d7dab39b
    Eric Sandeen 提交于
    This is based on commit d1f5273e
    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: NBernd Schubert <bernd.schubert@itwm.fraunhofer.de>
    Patch-updated-by: NEric Sandeen <sandeen@redhat.com>
    (blame us if something is not correct)
    Signed-off-by: NEric Sandeen <sandeen@redhat.com>
    Signed-off-by: NJan Kara <jack@suse.cz>
    d7dab39b
dir.c 15.4 KB