Whamcloud - gitweb
LU-12222 ptlrpc: Check if NID is local, not just lolnd NID 88/38388/3
authorChris Horn <hornc@cray.com>
Mon, 27 Apr 2020 15:07:21 +0000 (10:07 -0500)
committerOleg Drokin <green@whamcloud.com>
Wed, 20 May 2020 08:23:20 +0000 (08:23 +0000)
There's a couple places where we check whether a NID is the lolnd NID
but we really want to know whether the NID is local. Use
LNetIsPeerLocal() to accomplish this.

Signed-off-by: Chris Horn <hornc@cray.com>
Change-Id: Ia17b9b4b54fd1063c42a6f8bdd0e593be1086683
Reviewed-on: https://review.whamcloud.com/38388
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/mgc/mgc_request.c
lustre/target/tgt_handler.c

index f5734a0..ab709dd 100644 (file)
@@ -1608,7 +1608,7 @@ static int mgc_process_recover_nodemap_log(struct obd_device *obd,
        mgc_conn = class_exp2cliimp(cld->cld_mgcexp)->imp_connection;
 
        /* don't need to get local config */
        mgc_conn = class_exp2cliimp(cld->cld_mgcexp)->imp_connection;
 
        /* don't need to get local config */
-       if (cld_is_nodemap(cld) && (mgc_conn->c_peer.nid == LNET_NID_LO_0))
+       if (cld_is_nodemap(cld) && LNetIsPeerLocal(mgc_conn->c_peer.nid))
                GOTO(out, rc = 0);
 
        /* allocate buffer for bulk transfer.
                GOTO(out, rc = 0);
 
        /* allocate buffer for bulk transfer.
index c9a57bb..be4afa0 100644 (file)
@@ -915,12 +915,13 @@ int tgt_connect_check_sptlrpc(struct ptlrpc_request *req, struct obd_export *exp
                exp->exp_sp_peer = req->rq_sp_from;
                exp->exp_flvr = flvr;
 
                exp->exp_sp_peer = req->rq_sp_from;
                exp->exp_flvr = flvr;
 
-               /* when on mgs, if no restriction is set, or if client
-                * is loopback, allow any flavor */
+               /* when on mgs, if no restriction is set, or if the client
+                * NID is on the local node, allow any flavor
+                */
                if ((strcmp(exp->exp_obd->obd_type->typ_name,
                           LUSTRE_MGS_NAME) == 0) &&
                     (exp->exp_flvr.sf_rpc == SPTLRPC_FLVR_NULL ||
                if ((strcmp(exp->exp_obd->obd_type->typ_name,
                           LUSTRE_MGS_NAME) == 0) &&
                     (exp->exp_flvr.sf_rpc == SPTLRPC_FLVR_NULL ||
-                     exp->exp_connection->c_peer.nid == LNET_NID_LO_0))
+                     LNetIsPeerLocal(exp->exp_connection->c_peer.nid)))
                        exp->exp_flvr.sf_rpc = SPTLRPC_FLVR_ANY;
 
                if (exp->exp_flvr.sf_rpc != SPTLRPC_FLVR_ANY &&
                        exp->exp_flvr.sf_rpc = SPTLRPC_FLVR_ANY;
 
                if (exp->exp_flvr.sf_rpc != SPTLRPC_FLVR_ANY &&