From: Alexander.Boyko Date: Mon, 24 Nov 2014 10:55:15 +0000 (+0300) Subject: LU-5950 mgc: add nid iteration X-Git-Tag: 2.6.91~23 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=227ed3d87354cc1122343ef4f4e931960d1fe276 LU-5950 mgc: add nid iteration mgc_apply_recover_logs use only first nid from entry, this could be the problem for a cluster with several network address for a one node. Signed-off-by: Alexander Boyko Change-Id: I6ec348761c2d51edd613cb388e37ef7776990424 Xyratex-bug-id: MRP-2255 Reviewed-on: http://review.whamcloud.com/12829 Reviewed-by: Andreas Dilger Tested-by: Jenkins Reviewed-by: Mike Pershin Reviewed-by: Ann Koehler Tested-by: Maloo --- diff --git a/lustre/mgc/mgc_request.c b/lustre/mgc/mgc_request.c index 1788874..347590f 100644 --- a/lustre/mgc/mgc_request.c +++ b/lustre/mgc/mgc_request.c @@ -1394,7 +1394,7 @@ static int mgc_apply_recover_logs(struct obd_device *mgc, while (datalen > 0) { int entry_len = sizeof(*entry); - int is_ost; + int is_ost, i; struct obd_device *obd; char *obdname; char *cname; @@ -1500,11 +1500,17 @@ static int mgc_apply_recover_logs(struct obd_device *mgc, continue; } - /* TODO: iterate all nids to find one */ - /* find uuid by nid */ - rc = client_import_find_conn(obd->u.cli.cl_import, - entry->u.nids[0], - (struct obd_uuid *)uuid); + /* iterate all nids to find one */ + /* find uuid by nid */ + rc = -ENOENT; + for (i = 0; i < entry->mne_nid_count; i++) { + rc = client_import_find_conn(obd->u.cli.cl_import, + entry->u.nids[i], + (struct obd_uuid *)uuid); + if (rc == 0) + break; + } + up_read(&obd->u.cli.cl_sem); if (rc < 0) { CERROR("mgc: cannot find uuid by nid %s\n",