From da0196b9039a4d3323a8ce4e45e22256fb728d76 Mon Sep 17 00:00:00 2001
From: tappro <tappro>
Date: Sun, 14 Aug 2005 09:07:46 +0000
Subject: [PATCH] b=7214 - fix the getting own nid - use PtlGetId now

---
 lustre/osc/osc_request.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c
index 313a705333..291a801c02 100644
--- a/lustre/osc/osc_request.c
+++ b/lustre/osc/osc_request.c
@@ -2929,17 +2929,20 @@ static int osc_get_info(struct obd_export *exp, __u32 keylen,
         out:
                 ptlrpc_req_finished(req);
                 RETURN(rc);
-        } else if (keylen == 10 &&
-                   strcmp(key, "client_nid") == 0) {
+        } else if (keylen == 10 && strcmp(key, "client_nid") == 0) {
                 struct ptlrpc_connection * conn;
                 ptl_nid_t * nid = val;
                 *vallen = sizeof(*nid);
-                
+                ptl_process_id_t id;
+                int rc;
                 conn = class_exp2cliimp(exp)->imp_connection;
-                if (!conn) 
+                
+                if (!conn || !conn->c_peer.peer_ni) 
                         RETURN(-ENOTCONN);
                 
-                *nid = &conn->c_peer.peer_id.nid;
+                rc = PtlGetId(conn->c_peer.peer_ni->pni_ni_h, &id);
+                if (rc == PTL_OK)
+                        *nid = id.nid;
                 
                 RETURN(0);
         }
-- 
GitLab