From: NeilBrown Date: Fri, 6 Jan 2006 08:09:49 +0000 (-0800) Subject: [PATCH] knfsd: fix hash function for IP addresses on 64bit little-endian machines. X-Git-Tag: v2.6.16-rc1~936^2~285 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f1e030bf75774b6a283518e1534d598e14147d4;p=pandora-kernel.git [PATCH] knfsd: fix hash function for IP addresses on 64bit little-endian machines. The hash.h hash_long function, when used on a 64 bit machine, ignores many of the middle-order bits. (The prime chosen it too bit-sparse). IP addresses for clients of an NFS server are very likely to differ only in the low-order bits. As addresses are stored in network-byte-order, these bits become middle-order bits in a little-endian 64bit 'long', and so do not contribute to the hash. Thus you can have the situation where all clients appear on one hash chain. So, until hash_long is fixed (or maybe forever), us a hash function that works well on IP addresses - xor the bytes together. Thanks to "Iozone" for identifying this problem. Cc: "Iozone" Signed-off-by: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed