summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlyona Romanenko <alyona.romanenko@seagate.com>2016-03-02 22:01:50 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-03-02 23:23:49 (GMT)
commit5412d816dac18b9f035a753f54fc0e084c8cf376 (patch)
tree248a2870e6be47c23dc852edf5a95ba8ab1ea8dd
parent15dd2536671e9d0fd7880823b2f4bf0d2e43dbf5 (diff)
downloadlinux-5412d816dac18b9f035a753f54fc0e084c8cf376.tar.xz
staging: lustre: issue in the offset in lnet match hash table
the offset in hash table is overflowed for no wildcard portal. The offset for no wildcard has been corrected as for wildcard in the LU-1622 Signed-off-by: Alyona Romanenko <alyona.romanenko@seagate.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7774 Reviewed-on: http://review.whamcloud.com/18422 Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com> Reviewed-by: James Simmons <uja.ornl@yahoo.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/lustre/lnet/lnet/lib-ptl.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/staging/lustre/lnet/lnet/lib-ptl.c b/drivers/staging/lustre/lnet/lnet/lib-ptl.c
index 2b41205..3947e8b 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-ptl.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-ptl.c
@@ -360,16 +360,15 @@ lnet_mt_match_head(struct lnet_match_table *mtable,
lnet_process_id_t id, __u64 mbits)
{
struct lnet_portal *ptl = the_lnet.ln_portals[mtable->mt_portal];
+ unsigned long hash = mbits;
- if (lnet_ptl_is_wildcard(ptl)) {
- return &mtable->mt_mhash[mbits & LNET_MT_HASH_MASK];
- } else {
- unsigned long hash = mbits + id.nid + id.pid;
+ if (!lnet_ptl_is_wildcard(ptl)) {
+ hash += id.nid + id.pid;
LASSERT(lnet_ptl_is_unique(ptl));
hash = hash_long(hash, LNET_MT_HASH_BITS);
- return &mtable->mt_mhash[hash];
}
+ return &mtable->mt_mhash[hash & LNET_MT_HASH_MASK];
}
int