From 98a4b7903611fd88de9e0452118488997065081b Mon Sep 17 00:00:00 2001 From: Joshua Walgenbach Date: Mon, 28 Apr 2014 21:22:29 +0200 Subject: [PATCH] LU-4969 nodemap: nodemap key hash comparison 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 Change-Id: I464fa8c97cf77b57e7a0918a2bb5aee935bfc891 Reviewed-on: http://review.whamcloud.com/10147 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Andrew Perepechko --- lustre/nodemap/nodemap_handler.c | 6 +++--- lustre/nodemap/nodemap_idmap.c | 4 ++-- lustre/tests/sanity-sec.sh | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lustre/nodemap/nodemap_handler.c b/lustre/nodemap/nodemap_handler.c index 48b3b8e..1f68532 100644 --- a/lustre/nodemap/nodemap_handler.c +++ b/lustre/nodemap/nodemap_handler.c @@ -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) diff --git a/lustre/nodemap/nodemap_idmap.c b/lustre/nodemap/nodemap_idmap.c index 44382ff..8ff3063 100644 --- a/lustre/nodemap/nodemap_idmap.c +++ b/lustre/nodemap/nodemap_idmap.c @@ -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; } } diff --git a/lustre/tests/sanity-sec.sh b/lustre/tests/sanity-sec.sh index b1a68a5..628bd05 100644 --- a/lustre/tests/sanity-sec.sh +++ b/lustre/tests/sanity-sec.sh @@ -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 -- 1.8.3.1