tree 201e35c4e726119da7b6d251de29fbcdaed95116
parent bb5cffefa366dd264c4385c1e52e15f9e3126708
author Roland Dreier <[EMAIL PROTECTED]> Tue Apr 12 08:26:37 2005
committer Linus Torvalds <[EMAIL PROTECTED]> Tue Apr 12 08:26:37 2005

[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 <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

 fmr_pool.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

Index: drivers/infiniband/core/fmr_pool.c
===================================================================
--- 76ac203a7ae732ca37f8beffcede512b73acd612/drivers/infiniband/core/fmr_pool.c 
 (mode:100644 sha1:1e3c6306c8f9fc3030536846c9e2ceaab8630c49)
+++ 201e35c4e726119da7b6d251de29fbcdaed95116/drivers/infiniband/core/fmr_pool.c 
 (mode:100644 sha1:f1b74ccc3f78ce406c9689c8396241e97fd9d828)
@@ -103,9 +103,8 @@
 
 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 */
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to