From: Roland Dreier Date: Sat, 16 Apr 2005 22:26:10 +0000 (-0700) Subject: [PATCH] IB: Fix FMR pool crash X-Git-Tag: v2.6.12-rc3~86 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de0d9641c4f164009b62ecc342f9776d44e78b6a;p=linux-2.6 [PATCH] IB: Fix FMR pool crash Mask bits correctly from jhash result in ib_fmr_hash() so that the computed bucket index is within our hash table. This fixes an SDP crash. Signed-off-by: Roland Dreier Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/infiniband/core/fmr_pool.c b/drivers/infiniband/core/fmr_pool.c index 2e9469f189..59ee001ff0 100644 --- a/drivers/infiniband/core/fmr_pool.c +++ b/drivers/infiniband/core/fmr_pool.c @@ -103,9 +103,8 @@ struct ib_fmr_pool { static inline u32 ib_fmr_hash(u64 first_page) { - return jhash_2words((u32) first_page, - (u32) (first_page >> 32), - 0); + return jhash_2words((u32) first_page, (u32) (first_page >> 32), 0) & + (IB_FMR_HASH_SIZE - 1); } /* Caller must hold pool_lock */