diff --git a/lustre/ptlrpc/client.c b/lustre/ptlrpc/client.c index 8ea20368de9773862c9bcfec4c3b701f41685551..059891119aacf7cb3ca8102e7301d863bfb54363 100644 --- a/lustre/ptlrpc/client.c +++ b/lustre/ptlrpc/client.c @@ -1878,8 +1878,8 @@ restart: if ((brc == -ETIMEDOUT) && !ptlrpc_expire_one_request(req)) { /* Wait forever for reconnect / replay or failure */ lwi = LWI_INTR(interrupted_request, req); - rc = l_wait_event(req->rq_reply_waitq, ptlrpc_check_reply(req), - &lwi); + brc = l_wait_event(req->rq_reply_waitq, ptlrpc_check_reply(req), + &lwi); } CDEBUG(D_RPCTRACE, "Completed RPC pname:cluuid:pid:xid:nid:opc " @@ -1902,7 +1902,7 @@ restart: if (req->rq_err) { DEBUG_REQ(D_RPCTRACE, req, "err rc=%d status=%d", rc, req->rq_status); - GOTO(out, rc = -EIO); + GOTO(out, rc = rc ? rc : -EIO); } if (req->rq_intr) { diff --git a/lustre/ptlrpc/niobuf.c b/lustre/ptlrpc/niobuf.c index 2551d9079ca2445c1a107f3476bd33a998a23464..920786102c1072b5130cea67f4a3d8970d81cc98 100644 --- a/lustre/ptlrpc/niobuf.c +++ b/lustre/ptlrpc/niobuf.c @@ -482,6 +482,7 @@ int ptl_send_rpc(struct ptlrpc_request *request, int noreply) request->rq_import->imp_obd->obd_name); /* this prevents us from waiting in ptlrpc_queue_wait */ request->rq_err = 1; + request->rq_status = -ENODEV; RETURN(-ENODEV); } @@ -505,8 +506,12 @@ int ptl_send_rpc(struct ptlrpc_request *request, int noreply) LASSERT (request->rq_replen != 0); if (request->rq_repbuf == NULL) OBD_ALLOC(request->rq_repbuf, request->rq_replen); - if (request->rq_repbuf == NULL) + if (request->rq_repbuf == NULL) { + /* this prevents us from looping in ptlrpc_queue_wait */ + request->rq_err = 1; + request->rq_status = -ENOMEM; GOTO(cleanup_bulk, rc = -ENOMEM); + } request->rq_repmsg = NULL; rc = LNetMEAttach(request->rq_reply_portal,/*XXX FIXME bug 249*/