Whamcloud - gitweb
Branch HEAD
authorjohann <johann>
Mon, 6 Oct 2008 13:57:32 +0000 (13:57 +0000)
committerjohann <johann>
Mon, 6 Oct 2008 13:57:32 +0000 (13:57 +0000)
b=17261
i=shadow
i=umka

prevent ptlrpc_queue_wait() from looping indefinitely because of ENOMEM.

lustre/ptlrpc/client.c
lustre/ptlrpc/niobuf.c

index 565661a..42a456f 100644 (file)
@@ -2083,8 +2083,8 @@ repeat:
                   "-- sleeping for "CFS_DURATION_T" ticks", timeout);
         lwi = LWI_TIMEOUT_INTR(timeout, expired_request, interrupted_request,
                                req);
-        rc = l_wait_event(req->rq_reply_waitq, ptlrpc_check_reply(req), &lwi);
-        if (rc == -ETIMEDOUT && ((req->rq_deadline > cfs_time_current_sec()) ||
+        brc = l_wait_event(req->rq_reply_waitq, ptlrpc_check_reply(req), &lwi);
+        if (brc == -ETIMEDOUT && ((req->rq_deadline > cfs_time_current_sec()) ||
                                  ptlrpc_check_and_wait_suspend(req)))
                 goto repeat;
 
@@ -2109,7 +2109,7 @@ after_send:
         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) {
index 6d4226d..c83c877 100644 (file)
@@ -490,6 +490,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);
         }
 
@@ -521,8 +522,13 @@ int ptl_send_rpc(struct ptlrpc_request *request, int noreply)
                         LASSERT(request->rq_repmsg == NULL);
                         rc = sptlrpc_cli_alloc_repbuf(request,
                                                       request->rq_replen);
-                        if (rc)
+                        if (rc) {
+                                /* this prevents us from looping in
+                                 * ptlrpc_queue_wait */
+                                request->rq_err = 1;
+                                request->rq_status = rc;
                                 GOTO(cleanup_bulk, rc);
+                        }
                 } else {
                         request->rq_repdata = NULL;
                         request->rq_repmsg = NULL;