From: Oleg Drokin Date: Tue, 17 Apr 2012 06:31:10 +0000 (-0400) Subject: LU-1308 Properly add multihomed nids to peer table X-Git-Tag: 2.2.52~42 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=080fdc3d4ec7b02952f8485ebb1ed985c3a2823d;p=fs%2Flustre-release.git 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 --- 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);