Whamcloud - gitweb
LU-4969 nodemap: nodemap key hash comparison
[fs/lustre-release.git] / lustre / nodemap / nodemap_idmap.c
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;
                }
        }