[LU-5963] wrong hashing in LU-4647 Created: 28/Nov/14  Updated: 03/Dec/14  Resolved: 03/Dec/14

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.7.0
Fix Version/s: Lustre 2.7.0

Type: Bug Priority: Blocker
Reporter: Alexey Lyashkov Assignee: Nathaniel Clark
Resolution: Fixed Votes: 0
Labels: HB, nodemap, patch
Environment:

master from now.


Issue Links:
Related
is related to LU-4647 Add idmapping functions for nodemap Resolved
is related to LU-5928 sanity test_133f timeout: lprocfs_exp... Resolved
Severity: 3
Rank (Obsolete): 16655

 Description   

Sometimes recovery-small tests 50-52 failed on 8 CPU box. with leak a export reference. After some investigation i see nodemap don't able to found own entry for an export, but export still linked to node map. (i don't know why intel land something without any debug options in code?). per additional investigation i see someone

commit 83f04354ff68a14d7492e35a9576c91492a1206c
Author: Joshua Walgenbach <jjw@iu.edu>
Date: Mon Mar 3 09:10:20 2014 +0100

LU-4647 nodemap: add mapping functional
Signed-off-by: Joshua Walgenbach <jjw@iu.edu>
Signed-off-by: Kit Westneat <kit.westneat@gmail.com>
Reviewed-on: http://review.whamcloud.com/9299
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com>

have a bad inspection and allow to "hash" an export pointer as string.
so if any byte will be changed in export after add - we don't able to find something in hash.



 Comments   
Comment by Alexey Lyashkov [ 28/Nov/14 ]

this patch fixes problem

@@ -50,7 +52,12 @@ void nm_member_putref(struct obd_export *exp)
 static __u32 nm_member_hashfn(cfs_hash_t *hash_body,
                           const void *key, unsigned mask)
 {
-       return cfs_hash_djb2_hash(key, strlen(key), mask);
+       unsigned long hash;
+//     return cfs_hash_djb2_hash(key, strlen(key), mask);
+       hash = hash_long((unsigned long)key, hash_body->hs_bkt_bits) & mask;
+
+       CDEBUG(D_INFO, "hashing %p -> %lu\n", key, hash);
+       return hash;
 }
Comment by Gerrit Updater [ 29/Nov/14 ]

Alexey Lyashkov (alexey.lyashkov@seagate.com) uploaded a new patch: http://review.whamcloud.com/12881
Subject: LU-5963 nodemap: use proper hashing
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: b42e666cab01a40d867f88c0691846b03fc3fa25

Comment by Alexey Lyashkov [ 29/Nov/14 ]

http://review.whamcloud.com/12881

Comment by Gerrit Updater [ 03/Dec/14 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/12881/
Subject: LU-5963 nodemap: use proper hashing
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: b0236f7b024b5f76d8915334480dd6387f71451f

Comment by Nathaniel Clark [ 03/Dec/14 ]

Merged to master

Generated at Sat Feb 10 01:56:01 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.