Whamcloud - gitweb
LU-4969 nodemap: nodemap key hash comparison 47/10147/4
authorJoshua Walgenbach <jjw@iu.edu>
Mon, 28 Apr 2014 19:22:29 +0000 (21:22 +0200)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 4 Aug 2014 14:47:41 +0000 (14:47 +0000)
Changed the keymap comparison for the nodemap hash to the fix that
Andreas suggested, and fixed a bug with the idmap tree that resulted
in an incorrect deletion of idmaps.

Signed-off-by: Joshua Walgenbach <jjw@iu.edu>
Change-Id: I464fa8c97cf77b57e7a0918a2bb5aee935bfc891
Reviewed-on: http://review.whamcloud.com/10147
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Andrew Perepechko <andrew_perepechko@xyratex.com>
lustre/nodemap/nodemap_handler.c
lustre/nodemap/nodemap_idmap.c
lustre/tests/sanity-sec.sh

index 48b3b8e..1f68532 100644 (file)
@@ -115,11 +115,11 @@ static void *nodemap_hs_key(cfs_hlist_node_t *hnode)
 static int nodemap_hs_keycmp(const void *key,
                             cfs_hlist_node_t *compared_hnode)
 {
-       struct lu_nodemap *nodemap;
+       char *nodemap_name;
 
-       nodemap = nodemap_hs_key(compared_hnode);
+       nodemap_name = nodemap_hs_key(compared_hnode);
 
-       return !strcmp(key, nodemap->nm_name);
+       return !strcmp(key, nodemap_name);
 }
 
 static void *nodemap_hs_hashobject(cfs_hlist_node_t *hnode)
index 44382ff..8ff3063 100644 (file)
@@ -105,6 +105,7 @@ void idmap_insert(enum nodemap_id_type id_type, struct lu_idmap *idmap,
         * replacing to precent split brain idmaps
         */
        while (*fwd_node) {
+               fwd_parent = *fwd_node;
                cur = rb_entry(*fwd_node, struct lu_idmap,
                               id_client_to_fs);
 
@@ -117,11 +118,11 @@ void idmap_insert(enum nodemap_id_type id_type, struct lu_idmap *idmap,
                        break;
                }
 
-               fwd_parent = *fwd_node;
        }
 
        if (!replace) {
                while (*bck_node) {
+                       bck_parent = *bck_node;
                        cur = rb_entry(*bck_node, struct lu_idmap,
                                       id_fs_to_client);
 
@@ -134,7 +135,6 @@ void idmap_insert(enum nodemap_id_type id_type, struct lu_idmap *idmap,
                                break;
                        }
 
-                       bck_parent = *bck_node;
                }
        }
 
index b1a68a5..628bd05 100644 (file)
@@ -34,10 +34,10 @@ FAIL_ON_ERROR=false
 
 HOSTNAME_CHECKSUM=$(hostname | sum | awk '{ print $1 }')
 SUBNET_CHECKSUM=$(expr $HOSTNAME_CHECKSUM % 250 + 1)
-NODEMAP_COUNT=10
+NODEMAP_COUNT=16
 NODEMAP_RANGE_COUNT=3
 NODEMAP_IPADDR_COUNT=30
-NODEMAP_MAX_ID=600
+NODEMAP_MAX_ID=128
 
 require_dsh_mds || exit 0
 require_dsh_ost || exit 0