[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1474231143-4061-80-git-send-email-jsimmons@infradead.org>
Date: Sun, 18 Sep 2016 16:38:18 -0400
From: James Simmons <jsimmons@...radead.org>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
devel@...verdev.osuosl.org,
Andreas Dilger <andreas.dilger@...el.com>,
Oleg Drokin <oleg.drokin@...el.com>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Lustre Development List <lustre-devel@...ts.lustre.org>,
Alexander Boyko <alexander.boyko@...gate.com>,
James Simmons <jsimmons@...radead.org>
Subject: [PATCH 079/124] staging: lustre: mgc: add nid iteration
From: Alexander Boyko <alexander.boyko@...gate.com>
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 <alexander.boyko@...gate.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5950
Xyratex-bug-id: MRP-2255
Reviewed-on: http://review.whamcloud.com/12829
Reviewed-by: Andreas Dilger <andreas.dilger@...el.com>
Reviewed-by: Mike Pershin <mike.pershin@...el.com>
Reviewed-by: Ann Koehler <amk@...y.com>
Signed-off-by: James Simmons <jsimmons@...radead.org>
---
drivers/staging/lustre/lustre/mgc/mgc_request.c | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c b/drivers/staging/lustre/lustre/mgc/mgc_request.c
index 2191ca1..23374ca 100644
--- a/drivers/staging/lustre/lustre/mgc/mgc_request.c
+++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c
@@ -1159,7 +1159,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;
@@ -1265,11 +1265,17 @@ static int mgc_apply_recover_logs(struct obd_device *mgc,
continue;
}
- /* TODO: iterate all nids to find one */
+ /* 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);
+ rc = -ENOENT;
+ for (i = 0; i < entry->mne_nid_count; i++) {
+ rc = client_import_find_conn(obd->u.cli.cl_import,
+ entry->u.nids[0],
+ (struct obd_uuid *)uuid);
+ if (!rc)
+ break;
+ }
+
up_read(&obd->u.cli.cl_sem);
if (rc < 0) {
CERROR("mgc: cannot find uuid by nid %s\n",
--
1.7.1
Powered by blists - more mailing lists