From 46faa8a4f8f62ae56d0e4b087d0bc7d76b9512b8 Mon Sep 17 00:00:00 2001 From: pschwan Date: Mon, 15 Apr 2002 05:44:51 +0000 Subject: [PATCH] Fixed some thinkos in the remote connection/token stuff. Fixed a typo in the previous lock init fix. --- lustre/include/linux/lustre_net.h | 3 +++ lustre/ptlrpc/client.c | 6 +++--- lustre/ptlrpc/niobuf.c | 4 ++-- lustre/ptlrpc/service.c | 5 ++++- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/lustre/include/linux/lustre_net.h b/lustre/include/linux/lustre_net.h index 805bc0d..b6cf21e 100644 --- a/lustre/include/linux/lustre_net.h +++ b/lustre/include/linux/lustre_net.h @@ -79,6 +79,9 @@ struct ptlrpc_connection { atomic_t c_refcount; __u64 c_token; + + __u64 c_remote_conn; + __u64 c_remote_token; }; struct ptlrpc_client { diff --git a/lustre/ptlrpc/client.c b/lustre/ptlrpc/client.c index 9252705..e104155 100644 --- a/lustre/ptlrpc/client.c +++ b/lustre/ptlrpc/client.c @@ -120,14 +120,14 @@ struct ptlrpc_request *ptlrpc_prep_req(struct ptlrpc_client *cl, request->rq_type = PTL_RPC_REQUEST; request->rq_connection = ptlrpc_connection_addref(conn); - request->rq_reqmsg->conn = (__u64)(unsigned long)conn; - request->rq_reqmsg->token = conn->c_token; + request->rq_reqmsg->conn = (__u64)(unsigned long)conn->c_remote_conn; + request->rq_reqmsg->token = conn->c_remote_token; request->rq_reqmsg->opc = HTON__u32(opcode); request->rq_reqmsg->type = HTON__u32(request->rq_type); spin_lock(&conn->c_lock); request->rq_reqmsg->xid = HTON__u32(++conn->c_xid_out); - spin_unlock(&c->c_lock); + spin_unlock(&conn->c_lock); request->rq_client = cl; diff --git a/lustre/ptlrpc/niobuf.c b/lustre/ptlrpc/niobuf.c index 67c7309..5a0786f 100644 --- a/lustre/ptlrpc/niobuf.c +++ b/lustre/ptlrpc/niobuf.c @@ -207,8 +207,8 @@ int ptlrpc_reply(struct ptlrpc_service *svc, struct ptlrpc_request *req) { /* FIXME: we need to increment the count of handled events */ req->rq_type = PTL_RPC_REPLY; - req->rq_repmsg->conn = req->rq_reqmsg->conn; - req->rq_repmsg->token = req->rq_reqmsg->token; + req->rq_repmsg->conn = req->rq_connection->c_remote_conn; + req->rq_repmsg->token = req->rq_connection->c_remote_token; req->rq_repmsg->xid = HTON__u32(req->rq_reqmsg->xid); req->rq_repmsg->status = HTON__u32(req->rq_status); req->rq_reqmsg->type = HTON__u32(req->rq_type); diff --git a/lustre/ptlrpc/service.c b/lustre/ptlrpc/service.c index 031ae64..c36c68b 100644 --- a/lustre/ptlrpc/service.c +++ b/lustre/ptlrpc/service.c @@ -168,6 +168,10 @@ static int handle_incoming_request(struct obd_device *obddev, CDEBUG(D_NET, "got req %d\n", request.rq_reqmsg->xid); + /* FIXME: rq_reqmsg->conn should be, if nonzero, the local connection + * structure. Until we have the HA connect messages that we talked + * about, however, we don't have a way to exchange that address/token + * pair and this will always be zero. */ if (request.rq_reqmsg->conn) { request.rq_connection = (void *)(unsigned long)request.rq_reqmsg->conn; @@ -178,7 +182,6 @@ static int handle_incoming_request(struct obd_device *obddev, request.rq_connection = ptlrpc_get_connection(&peer); if (!request.rq_connection) LBUG(); - CERROR("Did not find valid/conn token pair.\n"); } peer.peer_nid = svc->srv_ev.initiator.nid; -- 1.8.3.1