From 1b79ce629892e59d99cb2b78e05f2c3b81fd7a40 Mon Sep 17 00:00:00 2001 From: pschwan Date: Thu, 24 Oct 2002 00:54:44 +0000 Subject: [PATCH] b=625069 - Workaround for 625069: send all LDLM requests, not just callbacks, to the LDLM portal - change CERROR in lov_getattr into CDEBUG --- lustre/include/linux/lustre_net.h | 3 +++ lustre/ldlm/ldlm_lockd.c | 30 +++++++++++++++++++++++++----- lustre/ldlm/ldlm_request.c | 10 ++++++++++ lustre/lov/lov_obd.c | 4 ++-- lustre/mds/handler.c | 23 ----------------------- lustre/ptlrpc/client.c | 5 +++++ lustre/ptlrpc/niobuf.c | 6 +++--- 7 files changed, 48 insertions(+), 33 deletions(-) diff --git a/lustre/include/linux/lustre_net.h b/lustre/include/linux/lustre_net.h index dc6c090..ea04322 100644 --- a/lustre/include/linux/lustre_net.h +++ b/lustre/include/linux/lustre_net.h @@ -131,6 +131,9 @@ struct ptlrpc_request { int rq_flags; atomic_t rq_refcount; + int rq_request_portal; /* XXX FIXME bug 625069 */ + int rq_reply_portal; /* XXX FIXME bug 625069 */ + int rq_reqlen; struct lustre_msg *rq_reqmsg; diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index a6abc5e..b56b4cb 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -501,6 +501,31 @@ static int ldlm_callback_handler(struct ptlrpc_request *req) OBD_FAIL_RETURN(OBD_FAIL_LDLM_CP_CALLBACK, 0); rc = ldlm_handle_cp_callback(req); RETURN(rc); + + /* XXX FIXME move these three back to mds/handler.c, bug 625069 */ + case LDLM_ENQUEUE: + CDEBUG(D_INODE, "enqueue\n"); + OBD_FAIL_RETURN(OBD_FAIL_LDLM_ENQUEUE, 0); + rc = ldlm_handle_enqueue(req); + if (rc) + break; + RETURN(0); + case LDLM_CONVERT: + CDEBUG(D_INODE, "convert\n"); + OBD_FAIL_RETURN(OBD_FAIL_LDLM_CONVERT, 0); + rc = ldlm_handle_convert(req); + if (rc) + break; + RETURN(0); + case LDLM_CANCEL: + CDEBUG(D_INODE, "cancel\n"); + OBD_FAIL_RETURN(OBD_FAIL_LDLM_CANCEL, 0); + rc = ldlm_handle_cancel(req); + if (rc) + break; + RETURN(0); + /* XXX FIXME move these three back to mds/handler.c, bug 625069 */ + default: CERROR("invalid opcode %d\n", req->rq_reqmsg->opc); RETURN(-EINVAL); @@ -531,11 +556,6 @@ static int ldlm_iocontrol(long cmd, struct lustre_handle *conn, int len, if (!connection) CERROR("No LDLM UUID found: assuming ldlm is local.\n"); - /* XXX - ptlrpc_init_client(LDLM_REQUEST_PORTAL, LDLM_REPLY_PORTAL, - obddev->u.ldlm.ldlm_client, connection); - */ - switch (cmd) { case IOC_LDLM_TEST: err = ldlm_test(obddev, conn); diff --git a/lustre/ldlm/ldlm_request.c b/lustre/ldlm/ldlm_request.c index 90ca711..ba219de 100644 --- a/lustre/ldlm/ldlm_request.c +++ b/lustre/ldlm/ldlm_request.c @@ -197,6 +197,9 @@ int ldlm_cli_enqueue(struct lustre_handle *connh, } else if (req->rq_reqmsg->buflens[0] != sizeof(*body)) LBUG(); + req->rq_request_portal = LDLM_REQUEST_PORTAL; /* XXX FIXME bug 625069 */ + req->rq_reply_portal = LDLM_REPLY_PORTAL; /* XXX FIXME bug 625069 */ + /* Dump all of this data into the request buffer */ body = lustre_msg_buf(req->rq_reqmsg, 0); ldlm_lock2desc(lock, &body->lock_desc); @@ -374,6 +377,9 @@ int ldlm_cli_convert(struct lustre_handle *lockh, int new_mode, int *flags) if (!req) GOTO(out, rc = -ENOMEM); + req->rq_request_portal = LDLM_REQUEST_PORTAL; /* XXX FIXME bug 625069 */ + req->rq_reply_portal = LDLM_REPLY_PORTAL; /* XXX FIXME bug 625069 */ + body = lustre_msg_buf(req->rq_reqmsg, 0); memcpy(&body->lock_handle1, &lock->l_remote_handle, sizeof(body->lock_handle1)); @@ -436,6 +442,10 @@ int ldlm_cli_cancel(struct lustre_handle *lockh) if (!req) GOTO(out, rc = -ENOMEM); + /* XXX FIXME bug 625069 */ + req->rq_request_portal = LDLM_REQUEST_PORTAL; + req->rq_reply_portal = LDLM_REPLY_PORTAL; + body = lustre_msg_buf(req->rq_reqmsg, 0); memcpy(&body->lock_handle1, &lock->l_remote_handle, sizeof(body->lock_handle1)); diff --git a/lustre/lov/lov_obd.c b/lustre/lov/lov_obd.c index 41f5ad8..05544f1 100644 --- a/lustre/lov/lov_obd.c +++ b/lustre/lov/lov_obd.c @@ -558,8 +558,8 @@ static int lov_getattr(struct lustre_handle *conn, struct obdo *oa, if (loi->loi_id == 0) continue; - CERROR("objid "LPX64"[%d] has subobj "LPX64" at idx %u\n", - oa->o_id, i, loi->loi_id, loi->loi_ost_idx); + CDEBUG(D_INFO, "objid "LPX64"[%d] has subobj "LPX64" at idx " + "%u\n", oa->o_id, i, loi->loi_id, loi->loi_ost_idx); /* create data objects with "parent" OA */ memcpy(&tmp, oa, sizeof(tmp)); tmp.o_id = loi->loi_id; diff --git a/lustre/mds/handler.c b/lustre/mds/handler.c index a3f32c7..a064ba3 100644 --- a/lustre/mds/handler.c +++ b/lustre/mds/handler.c @@ -1056,29 +1056,6 @@ int mds_handle(struct ptlrpc_request *req) rc = mds_close(req); break; - case LDLM_ENQUEUE: - CDEBUG(D_INODE, "enqueue\n"); - OBD_FAIL_RETURN(OBD_FAIL_LDLM_ENQUEUE, 0); - rc = ldlm_handle_enqueue(req); - if (rc) - break; - RETURN(0); - - case LDLM_CONVERT: - CDEBUG(D_INODE, "convert\n"); - OBD_FAIL_RETURN(OBD_FAIL_LDLM_CONVERT, 0); - rc = ldlm_handle_convert(req); - if (rc) - break; - RETURN(0); - - case LDLM_CANCEL: - CDEBUG(D_INODE, "cancel\n"); - OBD_FAIL_RETURN(OBD_FAIL_LDLM_CANCEL, 0); - rc = ldlm_handle_cancel(req); - if (rc) - break; - RETURN(0); case LDLM_BL_CALLBACK: case LDLM_CP_CALLBACK: CDEBUG(D_INODE, "callback\n"); diff --git a/lustre/ptlrpc/client.c b/lustre/ptlrpc/client.c index d6df605..75ea49c 100644 --- a/lustre/ptlrpc/client.c +++ b/lustre/ptlrpc/client.c @@ -169,6 +169,11 @@ struct ptlrpc_request *ptlrpc_prep_req(struct obd_import *imp, int opcode, request->rq_level = LUSTRE_CONN_FULL; request->rq_type = PTL_RPC_MSG_REQUEST; request->rq_import = imp; + + /* XXX FIXME bug 625069 */ + request->rq_request_portal = imp->imp_client->cli_request_portal; + request->rq_reply_portal = imp->imp_client->cli_reply_portal; + request->rq_connection = ptlrpc_connection_addref(conn); INIT_LIST_HEAD(&request->rq_list); diff --git a/lustre/ptlrpc/niobuf.c b/lustre/ptlrpc/niobuf.c index 13b32d7..3fe9192 100644 --- a/lustre/ptlrpc/niobuf.c +++ b/lustre/ptlrpc/niobuf.c @@ -355,7 +355,7 @@ int ptl_send_rpc(struct ptlrpc_request *request) } rc = PtlMEAttach(request->rq_connection->c_peer.peer_ni, - request->rq_import->imp_client->cli_reply_portal, + request->rq_reply_portal,/* XXX FIXME bug 625069 */ source_id, request->rq_xid, 0, PTL_UNLINK, PTL_INS_AFTER, &request->rq_reply_me_h); if (rc != PTL_OK) { @@ -382,14 +382,14 @@ int ptl_send_rpc(struct ptlrpc_request *request) CDEBUG(D_NET, "Setup reply buffer: %u bytes, xid "LPU64 ", portal %u\n", request->rq_replen, request->rq_xid, - request->rq_import->imp_client->cli_reply_portal); + request->rq_reply_portal); } /* Clear any flags that may be present from previous sends, * except for REPLAY. */ request->rq_flags &= PTL_RPC_FL_REPLAY; rc = ptl_send_buf(request, request->rq_connection, - request->rq_import->imp_client->cli_request_portal); + request->rq_request_portal); RETURN(rc); cleanup2: -- 1.8.3.1