Skip to content

Commit

Permalink
[PATCH] IB: Fix FMR pool crash
Browse files Browse the repository at this point in the history
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 <roland@topspin.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Roland Dreier authored and Linus Torvalds committed Apr 16, 2005
1 parent dfe7cc7 commit de0d964
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/infiniband/core/fmr_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit de0d964

Please sign in to comment.