From afb9714c097fc6ec53385c1b11c569890ba07651 Mon Sep 17 00:00:00 2001 From: Mr NeilBrown Date: Wed, 3 Aug 2022 21:43:26 -0400 Subject: [PATCH] LU-10391 ptlrpc: change rq_peer to struct lnet_nid rq_peer in struct ptlrpc_request can now store large NIDs. ptlrpc_connection_get() and others now take a struct lnet_processid Signed-off-by: Mr NeilBrown Change-Id: I3bb419720434714301946d278413ce6090aa2cdd Reviewed-on: https://review.whamcloud.com/44638 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Frank Sehr Reviewed-by: James Simmons Reviewed-by: Chris Horn Reviewed-by: Oleg Drokin --- lustre/include/lustre_net.h | 6 ++-- lustre/ldlm/ldlm_lib.c | 63 +++++++++++++++++++------------------- lustre/ldlm/ldlm_lockd.c | 4 +-- lustre/ldlm/ldlm_request.c | 2 +- lustre/mdt/mdt_lib.c | 32 ++++++++++--------- lustre/mgs/mgs_handler.c | 2 +- lustre/ptlrpc/client.c | 4 +-- lustre/ptlrpc/connection.c | 5 ++- lustre/ptlrpc/events.c | 14 ++++----- lustre/ptlrpc/gss/gss_svc_upcall.c | 26 ++++++++-------- lustre/ptlrpc/gss/sec_gss.c | 26 ++++++++-------- lustre/ptlrpc/lproc_ptlrpc.c | 2 +- lustre/ptlrpc/niobuf.c | 3 +- lustre/ptlrpc/nrs_crr.c | 13 ++++---- lustre/ptlrpc/nrs_delay.c | 2 +- lustre/ptlrpc/nrs_fifo.c | 4 +-- lustre/ptlrpc/nrs_tbf.c | 14 +++++---- lustre/ptlrpc/sec.c | 2 +- lustre/ptlrpc/service.c | 12 ++++---- lustre/target/tgt_handler.c | 22 ++++++------- lustre/target/tgt_lastrcvd.c | 4 +-- 21 files changed, 133 insertions(+), 129 deletions(-) diff --git a/lustre/include/lustre_net.h b/lustre/include/lustre_net.h index d28aa52..cd1acc9 100644 --- a/lustre/include/lustre_net.h +++ b/lustre/include/lustre_net.h @@ -1113,7 +1113,7 @@ struct ptlrpc_request { /** our LNet NID */ struct lnet_nid rq_self; /** Peer description (the other side) */ - struct lnet_process_id rq_peer; + struct lnet_processid rq_peer; /** Descriptor for the NID from which the peer sent the request. */ struct lnet_process_id rq_source; /** @@ -1894,7 +1894,7 @@ static inline bool nrs_policy_compat_one(const struct ptlrpc_service *svc, /* ptlrpc/events.c */ extern int ptlrpc_uuid_to_peer(struct obd_uuid *uuid, - struct lnet_process_id *peer, + struct lnet_processid *peer, struct lnet_nid *self, u32 refnet); /** @@ -1913,7 +1913,7 @@ extern void server_bulk_callback(struct lnet_event *ev); /** @} */ /* ptlrpc/connection.c */ -struct ptlrpc_connection *ptlrpc_connection_get(struct lnet_process_id peer, +struct ptlrpc_connection *ptlrpc_connection_get(struct lnet_processid *peer, struct lnet_nid *self, struct obd_uuid *uuid); diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index f26e042..6d16a63 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -989,7 +989,7 @@ static int rev_import_flags_update(struct obd_import *revimp, if (rc) { CERROR("%s: cannot get reverse import %s security: rc = %d\n", revimp->imp_client->cli_name, - libcfs_id2str(req->rq_peer), rc); + libcfs_idstr(&req->rq_peer), rc); return rc; } @@ -1098,7 +1098,7 @@ int target_handle_connect(struct ptlrpc_request *req) bool new_mds_mds_conn = false; struct obd_connect_data *data, *tmpdata; int size, tmpsize; - lnet_nid_t *client_nid = NULL; + lnet_nid_t client_nid; struct ptlrpc_connection *pcon = NULL; ENTRY; @@ -1116,7 +1116,7 @@ int target_handle_connect(struct ptlrpc_request *req) deuuidify(str, NULL, &target_start, &target_len); LCONSOLE_ERROR_MSG(0x137, "%s: not available for connect from %s (no target). If you are running an HA pair check that the target is mounted on the other server.\n", - str, libcfs_nid2str(req->rq_peer.nid)); + str, libcfs_nidstr(&req->rq_peer.nid)); GOTO(out, rc = -ENODEV); } @@ -1130,7 +1130,7 @@ int target_handle_connect(struct ptlrpc_request *req) deuuidify(str, NULL, &target_start, &target_len); LCONSOLE_INFO("%.*s: Not available for connect from %s (%s)\n", target_len, target_start, - libcfs_nid2str(req->rq_peer.nid), + libcfs_nidstr(&req->rq_peer.nid), (target->obd_stopping ? "stopping" : "not set up")); GOTO(out, rc = -ENODEV); @@ -1141,7 +1141,7 @@ int target_handle_connect(struct ptlrpc_request *req) CDEBUG(D_INFO, "%s: Temporarily refusing client connection from %s\n", - target->obd_name, libcfs_nid2str(req->rq_peer.nid)); + target->obd_name, libcfs_nidstr(&req->rq_peer.nid)); GOTO(out, rc = -EAGAIN); } @@ -1240,7 +1240,7 @@ int target_handle_connect(struct ptlrpc_request *req) LUSTRE_MINOR, LUSTRE_PATCH, LUSTRE_FIX, major, minor, patch, OBD_OCD_VERSION_FIX(data->ocd_version), - libcfs_nid2str(req->rq_peer.nid), + libcfs_nidstr(&req->rq_peer.nid), str); GOTO(out, rc = -EPROTO); } @@ -1263,33 +1263,33 @@ int target_handle_connect(struct ptlrpc_request *req) spin_unlock(&export->exp_lock); LCONSOLE_WARN("%s: Export %p already connecting from %s\n", export->exp_obd->obd_name, export, - libcfs_nid2str(req->rq_peer.nid)); + libcfs_nidstr(&req->rq_peer.nid)); class_export_put(export); export = NULL; rc = -EALREADY; } else if ((mds_conn || (lw_client && initial_conn) || OCD_HAS_FLAG(data, MDS_MDS)) && export->exp_connection) { spin_unlock(&export->exp_lock); - if (req->rq_peer.nid != - lnet_nid_to_nid4(&export->exp_connection->c_peer.nid)) { + if (!nid_same(&req->rq_peer.nid, + &export->exp_connection->c_peer.nid)) { /* MDS or LWP reconnected after failover. */ LCONSOLE_WARN("%s: Received %s connection from %s, removing former export from %s\n", target->obd_name, lw_client ? "LWP" : "MDS", - libcfs_nid2str(req->rq_peer.nid), + libcfs_nidstr(&req->rq_peer.nid), libcfs_nidstr(&export->exp_connection->c_peer.nid)); } else { /* New connection from the same NID. */ LCONSOLE_WARN("%s: Received new %s connection from %s, %s former export from same NID\n", target->obd_name, lw_client ? "LWP" : "MDS", - libcfs_nid2str(req->rq_peer.nid), + libcfs_nidstr(&req->rq_peer.nid), OCD_HAS_FLAG(data, MDS_MDS) ? "keep" : "remove"); } - if (req->rq_peer.nid == - lnet_nid_to_nid4(&export->exp_connection->c_peer.nid) && + if (nid_same(&req->rq_peer.nid, + &export->exp_connection->c_peer.nid) && OCD_HAS_FLAG(data, MDS_MDS)) { /* * Because exports between MDTs will always be @@ -1311,12 +1311,13 @@ int target_handle_connect(struct ptlrpc_request *req) rc = 0; } } else if (export->exp_connection != NULL && initial_conn && - req->rq_peer.nid != lnet_nid_to_nid4(&export->exp_connection->c_peer.nid)) { + !nid_same(&req->rq_peer.nid, + &export->exp_connection->c_peer.nid)) { spin_unlock(&export->exp_lock); /* In MDS failover we have static UUID but NID can change. */ LCONSOLE_WARN("%s: Client %s seen on new nid %s when existing nid %s is already connected\n", target->obd_name, cluuid.uuid, - libcfs_nid2str(req->rq_peer.nid), + libcfs_nidstr(&req->rq_peer.nid), libcfs_nidstr( &export->exp_connection->c_peer.nid)); rc = -EALREADY; @@ -1342,7 +1343,7 @@ no_export: atomic_read(&export->exp_rpc_count) > 0) { LCONSOLE_WARN("%s: Client %s (at %s) refused connection, still busy with %d references\n", target->obd_name, cluuid.uuid, - libcfs_nid2str(req->rq_peer.nid), + libcfs_nidstr(&req->rq_peer.nid), refcount_read(&export->exp_handle.h_ref)); GOTO(out, rc = -EBUSY); } else if (lustre_msg_get_conn_cnt(req->rq_reqmsg) == 1 && @@ -1350,7 +1351,7 @@ no_export: if (!strstr(cluuid.uuid, "mdt")) LCONSOLE_WARN("%s: Rejecting reconnect from the known client %s (at %s) because it is indicating it is a new client\n", target->obd_name, cluuid.uuid, - libcfs_nid2str(req->rq_peer.nid)); + libcfs_nidstr(&req->rq_peer.nid)); GOTO(out, rc = -EALREADY); } else { OBD_FAIL_TIMEOUT(OBD_FAIL_TGT_DELAY_RECONNECT, 2 * obd_timeout); @@ -1360,7 +1361,7 @@ no_export: GOTO(out, rc); CDEBUG(D_HA, "%s: connection from %s@%s %st%llu exp %p cur %lld last %lld\n", - target->obd_name, cluuid.uuid, libcfs_nid2str(req->rq_peer.nid), + target->obd_name, cluuid.uuid, libcfs_nidstr(&req->rq_peer.nid), target->obd_recovering ? "recovering/" : "", data->ocd_transno, export, ktime_get_seconds(), export ? export->exp_last_request_time : 0); @@ -1386,7 +1387,7 @@ no_export: /* Tell the client if we support replayable requests. */ if (target->obd_replayable) lustre_msg_add_op_flags(req->rq_repmsg, MSG_CONNECT_REPLAYABLE); - client_nid = &req->rq_peer.nid; + client_nid = lnet_nid_to_nid4(&req->rq_peer.nid); if (export == NULL) { /* allow lightweight connections during recovery */ @@ -1424,7 +1425,7 @@ no_export: LCONSOLE_WARN("%s: Denying connection for new client %s (at %s), waiting for %d known clients (%d recovered, %d in progress, and %d evicted) %s %lld:%.02lld\n", target->obd_name, cluuid.uuid, - libcfs_nid2str(req->rq_peer.nid), known, + libcfs_nidstr(&req->rq_peer.nid), known, connected - in_progress, in_progress, stale, msg, timeout / 60, timeout % 60); rc = -EBUSY; @@ -1432,7 +1433,7 @@ no_export: dont_check_exports: rc = obd_connect(req->rq_svc_thread->t_env, &export, target, &cluuid, data, - client_nid); + &client_nid); if (mds_conn && OBD_FAIL_CHECK(OBD_FAIL_TGT_RCVG_FLAG)) lustre_msg_add_op_flags(req->rq_repmsg, MSG_CONNECT_RECOVERING); @@ -1446,7 +1447,7 @@ dont_check_exports: } } else { rc = obd_reconnect(req->rq_svc_thread->t_env, - export, target, &cluuid, data, client_nid); + export, target, &cluuid, data, &client_nid); } if (rc) GOTO(out, rc); @@ -1481,7 +1482,7 @@ dont_check_exports: */ ptlrpc_request_change_export(req, export); - pcon = ptlrpc_connection_get(req->rq_peer, + pcon = ptlrpc_connection_get(&req->rq_peer, &req->rq_self, &cluuid); if (pcon == NULL) GOTO(out, rc = -ENOTCONN); @@ -1496,7 +1497,7 @@ dont_check_exports: spin_unlock(&export->exp_lock); CDEBUG(D_RPCTRACE, "%s: %s already connected at greater or equal conn_cnt: %d >= %d\n", - cluuid.uuid, libcfs_nid2str(req->rq_peer.nid), + cluuid.uuid, libcfs_nidstr(&req->rq_peer.nid), export->exp_conn_cnt, lustre_msg_get_conn_cnt(req->rq_reqmsg)); @@ -1507,8 +1508,8 @@ dont_check_exports: /* Check to see if connection came from another NID. */ if (export->exp_connection != NULL && - lnet_nid_to_nid4(&export->exp_connection->c_peer.nid) != - req->rq_peer.nid) { + !nid_same(&export->exp_connection->c_peer.nid, + &req->rq_peer.nid)) { obd_nid_del(export->exp_obd, export); ptlrpc_connection_put(export->exp_connection); export->exp_connection = NULL; @@ -2538,7 +2539,7 @@ static void drop_duplicate_replay_req(struct lu_env *env, DEBUG_REQ(D_HA, req, "remove t%lld from %s because duplicate update records found", lustre_msg_get_transno(req->rq_reqmsg), - libcfs_nid2str(req->rq_peer.nid)); + libcfs_nidstr(&req->rq_peer.nid)); /* * Right now, only for MDS reint operation update replay and @@ -2553,7 +2554,7 @@ static void drop_duplicate_replay_req(struct lu_env *env, target_send_reply(req, req->rq_status, 0); } else { DEBUG_REQ(D_ERROR, req, "wrong opc from %s", - libcfs_nid2str(req->rq_peer.nid)); + libcfs_nidstr(&req->rq_peer.nid)); } target_exp_dequeue_req_replay(req); target_request_copy_put(req); @@ -2637,7 +2638,7 @@ static void replay_request_or_update(struct lu_env *env, DEBUG_REQ(D_HA, req, "processing x%llu t%lld from %s", req->rq_xid, lustre_msg_get_transno(req->rq_reqmsg), - libcfs_nid2str(req->rq_peer.nid)); + libcfs_nidstr(&req->rq_peer.nid)); ptlrpc_watchdog_init(&thread->t_watchdog, WATCHDOG_TIMEOUT); @@ -2773,7 +2774,7 @@ static int target_recovery_thread(void *arg) while ((req = target_next_replay_lock(lut))) { LASSERT(trd->trd_processing_task == current->pid); DEBUG_REQ(D_HA, req, "processing lock from %s:", - libcfs_nid2str(req->rq_peer.nid)); + libcfs_nidstr(&req->rq_peer.nid)); if (OBD_FAIL_CHECK(OBD_FAIL_LDLM_LOCK_REPLAY)) { req->rq_status = -ENODEV; target_request_copy_put(req); @@ -2807,7 +2808,7 @@ static int target_recovery_thread(void *arg) while ((req = target_next_final_ping(obd))) { LASSERT(trd->trd_processing_task == current->pid); DEBUG_REQ(D_HA, req, "processing final ping from %s:", - libcfs_nid2str(req->rq_peer.nid)); + libcfs_nidstr(&req->rq_peer.nid)); handle_recovery_req(thread, req, trd->trd_recovery_handler); /* diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index 7e59709..f54b788 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -2306,7 +2306,7 @@ static inline void ldlm_callback_errmsg(struct ptlrpc_request *req, { DEBUG_REQ((req->rq_no_reply || rc) ? D_WARNING : D_DLMTRACE, req, "%s, NID=%s lock=%#llx: rc = %d", - msg, libcfs_id2str(req->rq_peer), + msg, libcfs_idstr(&req->rq_peer), handle ? handle->cookie : 0, rc); if (req->rq_no_reply) CWARN("No reply was sent, maybe cause b=21636.\n"); @@ -2516,7 +2516,7 @@ static int ldlm_cancel_handler(struct ptlrpc_request *req) CERROR("%s from %s arrived at %llu with bad export cookie %llu\n", ll_opcode2str(lustre_msg_get_opc(req->rq_reqmsg)), - libcfs_nid2str(req->rq_peer.nid), + libcfs_nidstr(&req->rq_peer.nid), (unsigned long long)req->rq_arrival_time.tv_sec, lustre_msg_get_handle(req->rq_reqmsg)->cookie); diff --git a/lustre/ldlm/ldlm_request.c b/lustre/ldlm/ldlm_request.c index 6fe7af9..62595ac 100644 --- a/lustre/ldlm/ldlm_request.c +++ b/lustre/ldlm/ldlm_request.c @@ -2402,7 +2402,7 @@ static int replay_lock_interpret(const struct lu_env *env, CERROR("received replay ack for unknown local cookie %#llx remote cookie %#llx from server %s id %s\n", aa->lock_handle.cookie, reply->lock_handle.cookie, req->rq_export->exp_client_uuid.uuid, - libcfs_id2str(req->rq_peer)); + libcfs_idstr(&req->rq_peer)); GOTO(out, rc = -ESTALE); } diff --git a/lustre/mdt/mdt_lib.c b/lustre/mdt/mdt_lib.c index a41865d..8099fa7 100644 --- a/lustre/mdt/mdt_lib.c +++ b/lustre/mdt/mdt_lib.c @@ -173,7 +173,7 @@ static int new_init_ucred(struct mdt_thread_info *info, ucred_init_type_t type, struct ptlrpc_user_desc *pud = req->rq_user_desc; struct lu_ucred *ucred = mdt_ucred(info); struct lu_nodemap *nodemap; - lnet_nid_t peernid = req->rq_peer.nid; + lnet_nid_t peernid = lnet_nid_to_nid4(&req->rq_peer.nid); __u32 perm = 0; int setuid; int setgid; @@ -373,8 +373,9 @@ bool allow_client_chgrp(struct mdt_thread_info *info, struct lu_ucred *uc) return false; /* 3. Check the permission in the identities. */ - perm = mdt_identity_get_perm(uc->uc_identity, - mdt_info_req(info)->rq_peer.nid); + perm = mdt_identity_get_perm( + uc->uc_identity, + lnet_nid_to_nid4(&mdt_info_req(info)->rq_peer.nid)); if (perm & CFS_SETGRP_PERM) return true; @@ -383,18 +384,18 @@ bool allow_client_chgrp(struct mdt_thread_info *info, struct lu_ucred *uc) int mdt_check_ucred(struct mdt_thread_info *info) { - struct ptlrpc_request *req = mdt_info_req(info); - struct mdt_device *mdt = info->mti_mdt; - struct ptlrpc_user_desc *pud = req->rq_user_desc; - struct lu_ucred *ucred = mdt_ucred(info); - struct md_identity *identity = NULL; - lnet_nid_t peernid = req->rq_peer.nid; - __u32 perm = 0; - int setuid; - int setgid; - int rc = 0; + struct ptlrpc_request *req = mdt_info_req(info); + struct mdt_device *mdt = info->mti_mdt; + struct ptlrpc_user_desc *pud = req->rq_user_desc; + struct lu_ucred *ucred = mdt_ucred(info); + struct md_identity *identity = NULL; + lnet_nid_t peernid = lnet_nid_to_nid4(&req->rq_peer.nid); + __u32 perm = 0; + int setuid; + int setgid; + int rc = 0; - ENTRY; + ENTRY; LASSERT(ucred != NULL); if ((ucred->uc_valid == UCRED_OLD) || (ucred->uc_valid == UCRED_NEW)) @@ -493,7 +494,8 @@ static int old_init_ucred_common(struct mdt_thread_info *info, uc->uc_identity = identity; /* process root_squash here. */ - mdt_root_squash(info, mdt_info_req(info)->rq_peer.nid); + mdt_root_squash(info, + lnet_nid_to_nid4(&mdt_info_req(info)->rq_peer.nid)); uc->uc_valid = UCRED_OLD; ucred_set_jobid(info, uc); diff --git a/lustre/mgs/mgs_handler.c b/lustre/mgs/mgs_handler.c index 33b0e27..cf4d69f 100644 --- a/lustre/mgs/mgs_handler.c +++ b/lustre/mgs/mgs_handler.c @@ -648,7 +648,7 @@ static int mgs_llog_open(struct tgt_session_info *tsi) LCONSOLE_WARN("%s: Unable to add client %s " "to file system %s: %d\n", tgt_name(tsi->tsi_tgt), - libcfs_nid2str(req->rq_peer.nid), + libcfs_nidstr(&req->rq_peer.nid), mgi->mgi_fsname, rc); } else { rc = 0; diff --git a/lustre/ptlrpc/client.c b/lustre/ptlrpc/client.c index 085db74..f1fe6dd 100644 --- a/lustre/ptlrpc/client.c +++ b/lustre/ptlrpc/client.c @@ -127,7 +127,7 @@ struct ptlrpc_connection *ptlrpc_uuid_to_connection(struct obd_uuid *uuid, { struct ptlrpc_connection *c; struct lnet_nid self; - struct lnet_process_id peer; + struct lnet_processid peer; int err; /* @@ -141,7 +141,7 @@ struct ptlrpc_connection *ptlrpc_uuid_to_connection(struct obd_uuid *uuid, return NULL; } - c = ptlrpc_connection_get(peer, &self, uuid); + c = ptlrpc_connection_get(&peer, &self, uuid); if (c) { memcpy(c->c_remote_uuid.uuid, uuid->uuid, sizeof(c->c_remote_uuid.uuid)); diff --git a/lustre/ptlrpc/connection.c b/lustre/ptlrpc/connection.c index ff359b1..d5a2e1d 100644 --- a/lustre/ptlrpc/connection.c +++ b/lustre/ptlrpc/connection.c @@ -76,14 +76,13 @@ static const struct rhashtable_params conn_hash_params = { }; struct ptlrpc_connection * -ptlrpc_connection_get(struct lnet_process_id peer4, struct lnet_nid *self, +ptlrpc_connection_get(struct lnet_processid *peer_orig, struct lnet_nid *self, struct obd_uuid *uuid) { struct ptlrpc_connection *conn, *conn2; - struct lnet_processid peer; + struct lnet_processid peer = *peer_orig; ENTRY; - lnet_pid4_to_pid(peer4, &peer); LNetPrimaryNID(&peer.nid); conn = rhashtable_lookup_fast(&conn_hash, &peer, conn_hash_params); if (conn) { diff --git a/lustre/ptlrpc/events.c b/lustre/ptlrpc/events.c index 479375a..19a0009 100644 --- a/lustre/ptlrpc/events.c +++ b/lustre/ptlrpc/events.c @@ -348,7 +348,7 @@ void request_in_callback(struct lnet_event *ev) req->rq_reqdata_len = ev->mlength; ktime_get_real_ts64(&req->rq_arrival_time); /* Multi-Rail: keep track of both initiator and source NID. */ - req->rq_peer = lnet_pid_to_pid4(&ev->initiator); + req->rq_peer = ev->initiator; req->rq_source = lnet_pid_to_pid4(&ev->source); req->rq_self = ev->target.nid; req->rq_rqbd = rqbd; @@ -358,7 +358,7 @@ void request_in_callback(struct lnet_event *ev) req, req->rq_xid, ev->mlength); CDEBUG(D_RPCTRACE, "peer: %s (source: %s)\n", - libcfs_id2str(req->rq_peer), libcfs_id2str(req->rq_source)); + libcfs_idstr(&req->rq_peer), libcfs_id2str(req->rq_source)); spin_lock(&svcpt->scp_lock); @@ -527,7 +527,7 @@ static void ptlrpc_master_callback(struct lnet_event *ev) } int ptlrpc_uuid_to_peer(struct obd_uuid *uuid, - struct lnet_process_id *peer, + struct lnet_processid *peer, struct lnet_nid *self, u32 refnet) { @@ -553,8 +553,8 @@ int ptlrpc_uuid_to_peer(struct obd_uuid *uuid, continue; if (dist == 0) { /* local! use loopback LND */ - peer->nid = LNET_NID_LO_0; - lnet_nid4_to_nid(peer->nid, self); + lnet_nid4_to_nid(LNET_NID_LO_0, self); + peer->nid = *self; rc = 0; break; } @@ -565,13 +565,13 @@ int ptlrpc_uuid_to_peer(struct obd_uuid *uuid, best_dist = dist; best_order = order; - peer->nid = lnet_nid_to_nid4(&dst_nid); + peer->nid = dst_nid; *self = src_nid; rc = 0; } } - CDEBUG(D_NET, "%s->%s\n", uuid->uuid, libcfs_id2str(*peer)); + CDEBUG(D_NET, "%s->%s\n", uuid->uuid, libcfs_idstr(peer)); return rc; } diff --git a/lustre/ptlrpc/gss/gss_svc_upcall.c b/lustre/ptlrpc/gss/gss_svc_upcall.c index 653c495..da84fad 100644 --- a/lustre/ptlrpc/gss/gss_svc_upcall.c +++ b/lustre/ptlrpc/gss/gss_svc_upcall.c @@ -922,7 +922,7 @@ int gss_svc_upcall_handle_init(struct ptlrpc_request *req, lnet_nid4_to_nid(req->rq_source.nid, &primary); LNetPrimaryNID(&primary); rsikey.nid4 = lnet_nid_to_nid4(&primary); - nodemap_test_nid(req->rq_peer.nid, rsikey.nm_name, + nodemap_test_nid(lnet_nid_to_nid4(&req->rq_peer.nid), rsikey.nm_name, sizeof(rsikey.nm_name)); /* duplicate context handle. for INIT it always 0 */ @@ -1024,7 +1024,7 @@ cache_check: "krb5") && !krb5_allow_old_client_csum) { CWARN("%s: deny connection from '%s' due to missing 'krb_csum' feature, set 'sptlrpc.gss.krb5_allow_old_client_csum=1' to allow, but recommend client upgrade: rc = %d\n", - target->obd_name, libcfs_nid2str(req->rq_peer.nid), + target->obd_name, libcfs_nidstr(&req->rq_peer.nid), -EPROTO); GOTO(out, rc = SECSVC_DROP); } else { @@ -1039,8 +1039,8 @@ cache_check: rsci->target = target; - CDEBUG(D_SEC, "server create rsc %p(%u->%s)\n", - rsci, rsci->ctx.gsc_uid, libcfs_nid2str(req->rq_peer.nid)); + CDEBUG(D_SEC, "server create rsc %p(%u->%s)\n", + rsci, rsci->ctx.gsc_uid, libcfs_nidstr(&req->rq_peer.nid)); if (rsip->out_handle.len > PTLRPC_GSS_MAX_HANDLE_SIZE) { CERROR("handle size %u too large\n", rsip->out_handle.len); @@ -1102,19 +1102,19 @@ out: } struct gss_svc_ctx *gss_svc_upcall_get_ctx(struct ptlrpc_request *req, - struct gss_wire_ctx *gw) + struct gss_wire_ctx *gw) { - struct rsc *rsc; + struct rsc *rsc; - rsc = gss_svc_searchbyctx(&gw->gw_handle); - if (!rsc) { + rsc = gss_svc_searchbyctx(&gw->gw_handle); + if (!rsc) { CWARN("Invalid gss ctx idx %#llx from %s\n", - gss_handle_to_u64(&gw->gw_handle), - libcfs_nid2str(req->rq_peer.nid)); - return NULL; - } + gss_handle_to_u64(&gw->gw_handle), + libcfs_nidstr(&req->rq_peer.nid)); + return NULL; + } - return &rsc->ctx; + return &rsc->ctx; } void gss_svc_upcall_put_ctx(struct gss_svc_ctx *ctx) diff --git a/lustre/ptlrpc/gss/sec_gss.c b/lustre/ptlrpc/gss/sec_gss.c index 7c80011..3a2a8bf 100644 --- a/lustre/ptlrpc/gss/sec_gss.c +++ b/lustre/ptlrpc/gss/sec_gss.c @@ -1968,9 +1968,9 @@ int gss_pack_err_notify(struct ptlrpc_request *req, __u32 major, __u32 minor) rs->rs_repdata_len = lustre_msg_size_v2(rs->rs_repbuf->lm_bufcount, rs->rs_repbuf->lm_buflens); - CDEBUG(D_SEC, "prepare gss error notify(0x%x/0x%x) to %s\n", - major, minor, libcfs_nid2str(req->rq_peer.nid)); - RETURN(0); + CDEBUG(D_SEC, "prepare gss error notify(0x%x/0x%x) to %s\n", + major, minor, libcfs_nidstr(&req->rq_peer.nid)); + RETURN(0); } static @@ -1987,8 +1987,8 @@ int gss_svc_handle_init(struct ptlrpc_request *req, int swabbed, rc; ENTRY; - CDEBUG(D_SEC, "processing gss init(%d) request from %s\n", gw->gw_proc, - libcfs_nid2str(req->rq_peer.nid)); + CDEBUG(D_SEC, "processing gss init(%d) request from %s\n", gw->gw_proc, + libcfs_nidstr(&req->rq_peer.nid)); req->rq_ctx_init = 1; @@ -2060,14 +2060,14 @@ int gss_svc_handle_init(struct ptlrpc_request *req, if (grctx->src_ctx->gsc_usr_mds || grctx->src_ctx->gsc_usr_oss || grctx->src_ctx->gsc_usr_root) CWARN("create svc ctx %p: user from %s authenticated as %s\n", - grctx->src_ctx, libcfs_nid2str(req->rq_peer.nid), + grctx->src_ctx, libcfs_nidstr(&req->rq_peer.nid), grctx->src_ctx->gsc_usr_root ? "root" : (grctx->src_ctx->gsc_usr_mds ? "mds" : (grctx->src_ctx->gsc_usr_oss ? "oss" : "null"))); else CWARN("create svc ctx %p: accept user %u from %s\n", grctx->src_ctx, grctx->src_ctx->gsc_uid, - libcfs_nid2str(req->rq_peer.nid)); + libcfs_nidstr(&req->rq_peer.nid)); if (gw->gw_flags & LUSTRE_GSS_PACK_USER) { if (reqbuf->lm_bufcount < 4) { @@ -2282,10 +2282,10 @@ int gss_svc_handle_data(struct ptlrpc_request *req, if (rc == 0) RETURN(SECSVC_OK); - CERROR("svc %u failed: major 0x%08x: req xid %llu ctx %p idx " - "%#llx(%u->%s)\n", gw->gw_svc, major, req->rq_xid, - grctx->src_ctx, gss_handle_to_u64(&gw->gw_handle), - grctx->src_ctx->gsc_uid, libcfs_nid2str(req->rq_peer.nid)); + CERROR("svc %u failed: major 0x%08x: req xid %llu ctx %p idx %#llx(%u->%s)\n", + gw->gw_svc, major, req->rq_xid, + grctx->src_ctx, gss_handle_to_u64(&gw->gw_handle), + grctx->src_ctx->gsc_uid, libcfs_nidstr(&req->rq_peer.nid)); error: /* we only notify client in case of NO_CONTEXT/BAD_SIG, which * might happen after server reboot, to allow recovery. */ @@ -2322,8 +2322,8 @@ int gss_svc_handle_destroy(struct ptlrpc_request *req, RETURN(SECSVC_DROP); CWARN("destroy svc ctx %p idx %#llx (%u->%s)\n", - grctx->src_ctx, gss_handle_to_u64(&gw->gw_handle), - grctx->src_ctx->gsc_uid, libcfs_nid2str(req->rq_peer.nid)); + grctx->src_ctx, gss_handle_to_u64(&gw->gw_handle), + grctx->src_ctx->gsc_uid, libcfs_nidstr(&req->rq_peer.nid)); gss_svc_upcall_destroy_ctx(grctx->src_ctx); diff --git a/lustre/ptlrpc/lproc_ptlrpc.c b/lustre/ptlrpc/lproc_ptlrpc.c index 7c06a49..92c1325 100644 --- a/lustre/ptlrpc/lproc_ptlrpc.c +++ b/lustre/ptlrpc/lproc_ptlrpc.c @@ -1065,7 +1065,7 @@ static int ptlrpc_lprocfs_svc_req_history_show(struct seq_file *s, void *iter) req->rq_export->exp_obd->obd_name : libcfs_nidstr_r(&req->rq_self, nidstr, sizeof(nidstr)), - libcfs_id2str(req->rq_peer), req->rq_xid, + libcfs_idstr(&req->rq_peer), req->rq_xid, req->rq_reqlen, ptlrpc_rqphase2str(req), (s64)req->rq_arrival_time.tv_sec, (s64)(req->rq_arrival_time.tv_nsec / NSEC_PER_USEC), diff --git a/lustre/ptlrpc/niobuf.c b/lustre/ptlrpc/niobuf.c index a1d0516..735b0a5 100644 --- a/lustre/ptlrpc/niobuf.c +++ b/lustre/ptlrpc/niobuf.c @@ -629,7 +629,8 @@ int ptlrpc_send_reply(struct ptlrpc_request *req, int flags) ptlrpc_at_set_reply(req, flags); if (req->rq_export == NULL || req->rq_export->exp_connection == NULL) - conn = ptlrpc_connection_get(req->rq_peer, &req->rq_self, NULL); + conn = ptlrpc_connection_get(&req->rq_peer, &req->rq_self, + NULL); else conn = ptlrpc_connection_addref(req->rq_export->exp_connection); diff --git a/lustre/ptlrpc/nrs_crr.c b/lustre/ptlrpc/nrs_crr.c index dc41970..f844c8e 100644 --- a/lustre/ptlrpc/nrs_crr.c +++ b/lustre/ptlrpc/nrs_crr.c @@ -97,7 +97,7 @@ static struct binheap_ops nrs_crrn_heap_ops = { /** * rhashtable operations for nrs_crrn_net::cn_cli_hash * - * This uses ptlrpc_request::rq_peer.nid as its key, in order to hash + * This uses ptlrpc_request::rq_peer.nid (as nid4) as its key, in order to hash * nrs_crrn_client objects. */ static u32 nrs_crrn_hashfn(const void *data, u32 len, u32 seed) @@ -293,6 +293,7 @@ static int nrs_crrn_res_get(struct ptlrpc_nrs_policy *policy, struct nrs_crrn_client *cli; struct nrs_crrn_client *tmp; struct ptlrpc_request *req; + lnet_nid_t nid4; if (parent == NULL) { *resp = &((struct nrs_crrn_net *)policy->pol_private)->cn_res; @@ -301,8 +302,8 @@ static int nrs_crrn_res_get(struct ptlrpc_nrs_policy *policy, net = container_of(parent, struct nrs_crrn_net, cn_res); req = container_of(nrq, struct ptlrpc_request, rq_nrq); - - cli = rhashtable_lookup_fast(&net->cn_cli_hash, &req->rq_peer.nid, + nid4 = lnet_nid_to_nid4(&req->rq_peer.nid); + cli = rhashtable_lookup_fast(&net->cn_cli_hash, &nid4, nrs_crrn_hash_params); if (cli) goto out; @@ -312,7 +313,7 @@ static int nrs_crrn_res_get(struct ptlrpc_nrs_policy *policy, if (cli == NULL) return -ENOMEM; - cli->cc_nid = req->rq_peer.nid; + cli->cc_nid = nid4; atomic_set(&cli->cc_ref, 0); @@ -399,7 +400,7 @@ struct ptlrpc_nrs_request *nrs_crrn_req_get(struct ptlrpc_nrs_policy *policy, CDEBUG(D_RPCTRACE, "NRS: starting to handle %s request from %s, with round " "%llu\n", NRS_POL_NAME_CRRN, - libcfs_id2str(req->rq_peer), nrq->nr_u.crr.cr_round); + libcfs_idstr(&req->rq_peer), nrq->nr_u.crr.cr_round); /** Peek at the next request to be served */ node = binheap_root(net->cn_binheap); @@ -569,7 +570,7 @@ static void nrs_crrn_req_stop(struct ptlrpc_nrs_policy *policy, CDEBUG(D_RPCTRACE, "NRS: finished handling %s request from %s, with round %llu" "\n", NRS_POL_NAME_CRRN, - libcfs_id2str(req->rq_peer), nrq->nr_u.crr.cr_round); + libcfs_idstr(&req->rq_peer), nrq->nr_u.crr.cr_round); } /** diff --git a/lustre/ptlrpc/nrs_delay.c b/lustre/ptlrpc/nrs_delay.c index a39a9cf..e8304a1 100644 --- a/lustre/ptlrpc/nrs_delay.c +++ b/lustre/ptlrpc/nrs_delay.c @@ -297,7 +297,7 @@ static void nrs_delay_req_stop(struct ptlrpc_nrs_policy *policy, DEBUG_REQ(D_RPCTRACE, req, "NRS: finished delayed request from %s after %llds", - libcfs_id2str(req->rq_peer), + libcfs_idstr(&req->rq_peer), (s64)(nrq->nr_u.delay.req_start_time - req->rq_srv.sr_arrival_time.tv_sec)); } diff --git a/lustre/ptlrpc/nrs_fifo.c b/lustre/ptlrpc/nrs_fifo.c index 2142ff4..177f90f 100644 --- a/lustre/ptlrpc/nrs_fifo.c +++ b/lustre/ptlrpc/nrs_fifo.c @@ -176,7 +176,7 @@ struct ptlrpc_nrs_request * nrs_fifo_req_get(struct ptlrpc_nrs_policy *policy, CDEBUG(D_RPCTRACE, "NRS start %s request from %s, seq: %llu" "\n", policy->pol_desc->pd_name, - libcfs_id2str(req->rq_peer), nrq->nr_u.fifo.fr_sequence); + libcfs_idstr(&req->rq_peer), nrq->nr_u.fifo.fr_sequence); } return nrq; @@ -237,7 +237,7 @@ static void nrs_fifo_req_stop(struct ptlrpc_nrs_policy *policy, rq_nrq); CDEBUG(D_RPCTRACE, "NRS stop %s request from %s, seq: %llu\n", - policy->pol_desc->pd_name, libcfs_id2str(req->rq_peer), + policy->pol_desc->pd_name, libcfs_idstr(&req->rq_peer), nrq->nr_u.fifo.fr_sequence); } diff --git a/lustre/ptlrpc/nrs_tbf.c b/lustre/ptlrpc/nrs_tbf.c index eca5bb5..22a2f69 100644 --- a/lustre/ptlrpc/nrs_tbf.c +++ b/lustre/ptlrpc/nrs_tbf.c @@ -1037,7 +1037,7 @@ static struct nrs_tbf_ops nrs_tbf_jobid_ops = { /** * libcfs_hash operations for nrs_tbf_net::cn_cli_hash * - * This uses ptlrpc_request::rq_peer.nid as its key, in order to hash + * This uses ptlrpc_request::rq_peer.nid (as nid4) as its key, in order to hash * nrs_tbf_client objects. */ #define NRS_TBF_NID_BKT_BITS 8 @@ -1114,7 +1114,9 @@ static struct nrs_tbf_client * nrs_tbf_nid_cli_find(struct nrs_tbf_head *head, struct ptlrpc_request *req) { - return cfs_hash_lookup(head->th_cli_hash, &req->rq_peer.nid); + lnet_nid_t nid4 = lnet_nid_to_nid4(&req->rq_peer.nid); + + return cfs_hash_lookup(head->th_cli_hash, &nid4); } static struct nrs_tbf_client * @@ -1170,7 +1172,7 @@ static void nrs_tbf_nid_cli_init(struct nrs_tbf_client *cli, struct ptlrpc_request *req) { - cli->tc_nid = req->rq_peer.nid; + cli->tc_nid = lnet_nid_to_nid4(&req->rq_peer.nid); } static int nrs_tbf_nid_rule_init(struct ptlrpc_nrs_policy *policy, @@ -1637,14 +1639,14 @@ static inline void nrs_tbf_cli_gen_key(struct nrs_tbf_client *cli, jobid = NRS_TBF_JOBID_NULL; snprintf(keystr, keystr_sz, "%s_%s_%d_%u_%u", jobid, - libcfs_nid2str(req->rq_peer.nid), opc, id.ti_uid, + libcfs_nidstr(&req->rq_peer.nid), opc, id.ti_uid, id.ti_gid); if (cli) { INIT_LIST_HEAD(&cli->tc_lru); strlcpy(cli->tc_key, keystr, sizeof(cli->tc_key)); strlcpy(cli->tc_jobid, jobid, sizeof(cli->tc_jobid)); - cli->tc_nid = req->rq_peer.nid; + cli->tc_nid = lnet_nid_to_nid4(&req->rq_peer.nid); cli->tc_opcode = opc; cli->tc_id = id; } @@ -3252,7 +3254,7 @@ static void nrs_tbf_req_stop(struct ptlrpc_nrs_policy *policy, assert_spin_locked(&policy->pol_nrs->nrs_svcpt->scp_req_lock); CDEBUG(D_RPCTRACE, "NRS stop %s request from %s, seq: %llu\n", - policy->pol_desc->pd_name, libcfs_id2str(req->rq_peer), + policy->pol_desc->pd_name, libcfs_idstr(&req->rq_peer), nrq->nr_u.tbf.tr_sequence); } diff --git a/lustre/ptlrpc/sec.c b/lustre/ptlrpc/sec.c index 7a19f5c..c308b69 100644 --- a/lustre/ptlrpc/sec.c +++ b/lustre/ptlrpc/sec.c @@ -2238,7 +2238,7 @@ int sptlrpc_svc_unwrap_request(struct ptlrpc_request *req) break; default: CERROR("error unpacking request from %s x%llu\n", - libcfs_id2str(req->rq_peer), req->rq_xid); + libcfs_idstr(&req->rq_peer), req->rq_xid); RETURN(SECSVC_DROP); } diff --git a/lustre/ptlrpc/service.c b/lustre/ptlrpc/service.c index 4453e4d..9e7c34c 100644 --- a/lustre/ptlrpc/service.c +++ b/lustre/ptlrpc/service.c @@ -2089,7 +2089,7 @@ static int ptlrpc_server_handle_req_in(struct ptlrpc_service_part *svcpt, rc = ptlrpc_unpack_req_msg(req, req->rq_reqlen); if (rc != 0) { CERROR("error unpacking request: ptl %d from %s x%llu\n", - svc->srv_req_portal, libcfs_id2str(req->rq_peer), + svc->srv_req_portal, libcfs_idstr(&req->rq_peer), req->rq_xid); goto err_req; } @@ -2098,7 +2098,7 @@ static int ptlrpc_server_handle_req_in(struct ptlrpc_service_part *svcpt, rc = lustre_unpack_req_ptlrpc_body(req, MSG_PTLRPC_BODY_OFF); if (rc) { CERROR("error unpacking ptlrpc body: ptl %d from %s x %llu\n", - svc->srv_req_portal, libcfs_id2str(req->rq_peer), + svc->srv_req_portal, libcfs_idstr(&req->rq_peer), req->rq_xid); goto err_req; } @@ -2115,7 +2115,7 @@ static int ptlrpc_server_handle_req_in(struct ptlrpc_service_part *svcpt, if (lustre_msg_get_type(req->rq_reqmsg) != PTL_RPC_MSG_REQUEST) { CERROR("wrong packet type received (type=%u) from %s\n", lustre_msg_get_type(req->rq_reqmsg), - libcfs_id2str(req->rq_peer)); + libcfs_idstr(&req->rq_peer)); goto err_req; } @@ -2284,7 +2284,7 @@ static int ptlrpc_server_handle_request(struct ptlrpc_service_part *svcpt, if (ktime_get_real_seconds() > request->rq_deadline) { DEBUG_REQ(D_ERROR, request, "Dropping timed-out request from %s: deadline %lld/%llds ago", - libcfs_id2str(request->rq_peer), + libcfs_idstr(&request->rq_peer), request->rq_deadline - request->rq_arrival_time.tv_sec, ktime_get_real_seconds() - request->rq_deadline); @@ -2299,7 +2299,7 @@ static int ptlrpc_server_handle_request(struct ptlrpc_service_part *svcpt, (request->rq_export ? refcount_read(&request->rq_export->exp_handle.h_ref) : -99), lustre_msg_get_status(request->rq_reqmsg), request->rq_xid, - libcfs_id2str(request->rq_peer), + libcfs_idstr(&request->rq_peer), lustre_msg_get_opc(request->rq_reqmsg), lustre_msg_get_jobid(request->rq_reqmsg) ?: ""); @@ -2340,7 +2340,7 @@ put_conn: refcount_read(&request->rq_export->exp_handle.h_ref) : -99), lustre_msg_get_status(request->rq_reqmsg), request->rq_xid, - libcfs_id2str(request->rq_peer), + libcfs_idstr(&request->rq_peer), lustre_msg_get_opc(request->rq_reqmsg), lustre_msg_get_jobid(request->rq_reqmsg) ?: "", timediff_usecs, diff --git a/lustre/target/tgt_handler.c b/lustre/target/tgt_handler.c index 83a8ddb..7572c0e 100644 --- a/lustre/target/tgt_handler.c +++ b/lustre/target/tgt_handler.c @@ -633,7 +633,7 @@ static struct tgt_handler *tgt_handler_find_check(struct ptlrpc_request *req) if (unlikely(s->tos_hs == NULL)) { if (!printed) { CERROR("%s: no handler for opcode 0x%x from %s\n", - tgt_name(tgt), opc, libcfs_id2str(req->rq_peer)); + tgt_name(tgt), opc, libcfs_idstr(&req->rq_peer)); printed = true; } goto err_unsupported; @@ -801,7 +801,7 @@ int tgt_request_handle(struct ptlrpc_request *req) GOTO(handle_recov, rc = 0); } CDEBUG(D_HA, "operation %d on unconnected OST from %s\n", - opc, libcfs_id2str(req->rq_peer)); + opc, libcfs_idstr(&req->rq_peer)); req->rq_status = -ENOTCONN; rc = ptlrpc_error(req); GOTO(out, rc); @@ -953,7 +953,7 @@ int tgt_connect_check_sptlrpc(struct ptlrpc_request *req, struct obd_export *exp read_lock(&tgt->lut_sptlrpc_lock); sptlrpc_target_choose_flavor(&tgt->lut_sptlrpc_rset, req->rq_sp_from, - req->rq_peer.nid, + lnet_nid_to_nid4(&req->rq_peer.nid), &flvr); read_unlock(&tgt->lut_sptlrpc_lock); @@ -975,7 +975,7 @@ int tgt_connect_check_sptlrpc(struct ptlrpc_request *req, struct obd_export *exp CERROR("%s: unauthorized rpc flavor %x from %s, " "expect %x\n", tgt_name(tgt), req->rq_flvr.sf_rpc, - libcfs_nid2str(req->rq_peer.nid), + libcfs_nidstr(&req->rq_peer.nid), exp->exp_flvr.sf_rpc); rc = -EACCES; } @@ -1980,7 +1980,7 @@ static void dump_all_bulk_pages(struct obdo *oa, int count, static int check_read_checksum(struct niobuf_local *local_nb, int npages, struct obd_export *exp, struct obdo *oa, - const struct lnet_process_id *peer, + const struct lnet_processid *peer, __u32 client_cksum, __u32 server_cksum, enum cksum_types server_cksum_type) { @@ -2020,7 +2020,7 @@ static int check_read_checksum(struct niobuf_local *local_nb, int npages, DFID " object "DOSTID" extent [%llu-%llu], client returned csum" " %x (type %x), server csum %x (type %x)\n", exp->exp_obd->obd_name, - msg, libcfs_nid2str(peer->nid), + msg, libcfs_nidstr(&peer->nid), oa->o_valid & OBD_MD_FLFID ? oa->o_parent_seq : 0ULL, oa->o_valid & OBD_MD_FLFID ? oa->o_parent_oid : 0, oa->o_valid & OBD_MD_FLFID ? oa->o_parent_ver : 0, @@ -2379,7 +2379,7 @@ int tgt_brw_read(struct tgt_session_info *tsi) OBD_FAIL_CHECK(OBD_FAIL_OST_DROP_REQ)) { no_reply = 1; CERROR("Dropping timed-out read from %s because locking object " DOSTID " took %lld seconds (limit was %lld).\n", - libcfs_id2str(req->rq_peer), POSTID(&ioo->ioo_oid), + libcfs_idstr(&req->rq_peer), POSTID(&ioo->ioo_oid), ktime_get_real_seconds() - req->rq_arrival_time.tv_sec, req->rq_deadline - req->rq_arrival_time.tv_sec); GOTO(out_lock, rc = -ETIMEDOUT); @@ -2606,7 +2606,7 @@ static void tgt_warn_on_cksum(struct ptlrpc_request *req, body = req_capsule_client_get(&req->rq_pill, &RMF_OST_BODY); LASSERT(body != NULL); - if (desc && req->rq_peer.nid != desc->bd_sender) { + if (desc && lnet_nid_to_nid4(&req->rq_peer.nid) != desc->bd_sender) { via = " via "; router = libcfs_nid2str(desc->bd_sender); } @@ -2624,7 +2624,7 @@ static void tgt_warn_on_cksum(struct ptlrpc_request *req, LCONSOLE_ERROR_MSG(0x168, "%s: BAD WRITE CHECKSUM: from %s%s%s inode " DFID" object "DOSTID" extent [%llu-%llu" "]: client csum %x, server csum %x\n", - exp->exp_obd->obd_name, libcfs_id2str(req->rq_peer), + exp->exp_obd->obd_name, libcfs_idstr(&req->rq_peer), via, router, body->oa.o_valid & OBD_MD_FLFID ? body->oa.o_parent_seq : (__u64)0, @@ -2768,7 +2768,7 @@ int tgt_brw_write(struct tgt_session_info *tsi) OBD_FAIL_CHECK(OBD_FAIL_OST_DROP_REQ)) { no_reply = true; CERROR("%s: Dropping timed-out write from %s because locking object " DOSTID " took %lld seconds (limit was %lld).\n", - tgt_name(tsi->tsi_tgt), libcfs_id2str(req->rq_peer), + tgt_name(tsi->tsi_tgt), libcfs_idstr(&req->rq_peer), POSTID(&ioo->ioo_oid), ktime_get_real_seconds() - req->rq_arrival_time.tv_sec, req->rq_deadline - req->rq_arrival_time.tv_sec); @@ -2866,7 +2866,7 @@ skip_transfer: } else if ((cksum_counter & (-cksum_counter)) == cksum_counter) { CDEBUG(D_INFO, "Checksum %u from %s OK: %x\n", - cksum_counter, libcfs_id2str(req->rq_peer), + cksum_counter, libcfs_idstr(&req->rq_peer), repbody->oa.o_cksum); } } diff --git a/lustre/target/tgt_lastrcvd.c b/lustre/target/tgt_lastrcvd.c index 387223c..6e11f8c 100644 --- a/lustre/target/tgt_lastrcvd.c +++ b/lustre/target/tgt_lastrcvd.c @@ -960,7 +960,6 @@ static int tgt_is_local_client(const struct lu_env *env, struct lu_target *tgt = class_exp2tgt(exp); struct tgt_session_info *tsi = tgt_ses_info(env); struct ptlrpc_request *req = tgt_ses_req(tsi); - struct lnet_nid nid; if (exp_connect_flags(exp) & OBD_CONNECT_MDS || exp_connect_flags(exp) & OBD_CONNECT_MDS_MDS) @@ -969,8 +968,7 @@ static int tgt_is_local_client(const struct lu_env *env, return 0; if (!req) return 0; - lnet_nid4_to_nid(req->rq_peer.nid, &nid); - if (!LNetIsPeerLocal(&nid)) + if (!LNetIsPeerLocal(&req->rq_peer.nid)) return 0; return 1; -- 1.8.3.1