From 080fdc3d4ec7b02952f8485ebb1ed985c3a2823d Mon Sep 17 00:00:00 2001 From: Oleg Drokin Date: Tue, 17 Apr 2012 02:31:10 -0400 Subject: [PATCH] LU-1308 Properly add multihomed nids to peer table class_add_uuid had a copy&paste error where it was checking against wrong entry for nid tables and as such had trouble finding multihomed nid configurations. Change-Id: I2d73bdde9cf7b0bf882b14b473b4491873e64c25 Signed-off-by: Oleg Drokin Reviewed-on: http://review.whamcloud.com/2561 Reviewed-by: Jinshan Xiong Tested-by: Hudson Tested-by: Maloo Reviewed-by: Mike Pershin --- lustre/obdclass/lustre_peer.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lustre/obdclass/lustre_peer.c b/lustre/obdclass/lustre_peer.c index a8c26e3..014e714 100644 --- a/lustre/obdclass/lustre_peer.c +++ b/lustre/obdclass/lustre_peer.c @@ -122,15 +122,15 @@ int class_add_uuid(const char *uuid, __u64 nid) int i; found = 1; - for (i = 0; i < data->un_nid_count; i++) + for (i = 0; i < entry->un_nid_count; i++) if (nid == entry->un_nids[i]) break; - if (i == data->un_nid_count) { - LASSERT(data->un_nid_count < NIDS_MAX); - data->un_nids[++data->un_nid_count] = nid; - break; + if (i == entry->un_nid_count) { + LASSERT(entry->un_nid_count < NIDS_MAX); + entry->un_nids[++entry->un_nid_count] = nid; } + break; } } if (!found) @@ -213,6 +213,7 @@ int class_check_uuid(struct obd_uuid *uuid, __u64 nid) break; } } + break; } cfs_spin_unlock (&g_uuid_lock); RETURN(found); -- 1.8.3.1