• Andrew Morton's avatar
    [PATCH] htree nfs fix · 699155e3
    Andrew Morton authored
    Patch from "Theodore Ts'o" <tytso@mit.edu>
    
    We now use 0x7ffffff as the EOF cookie, because Linux NFS stupidly interprets
    the cookie (which is supposed to be a bag of bits without necessarily any
    semantic value) as a signed 64 bit integer, and then converts it to a
    unsigned integer, and then blows up if it cannot be expressed be expressed as
    a 32-bit value!!
    
    In order to do this, we have to fold the hash value 0x7ffffff into the hash
    value 0x7ffffffe.  This is relatively safe; the only time we will lose if the
    directory contains filenames that hash to both 0x7ffffffe and 0x7fffffff
    (under the original hash), and the last directory entry which hashes to
    0x7ffffffe is at the end of a leaf block, and the first directory entry which
    hashes to 0x7fffffff is at the beginning of a leaf block.
    699155e3
hash.c 4.97 KB