Whamcloud - gitweb
b=611336
authorpschwan <pschwan>
Thu, 26 Sep 2002 20:56:00 +0000 (20:56 +0000)
committerpschwan <pschwan>
Thu, 26 Sep 2002 20:56:00 +0000 (20:56 +0000)
Until we really fix 611336 to never send larger IOV requests than the server
can handle, we should at least avoid _crashing_ the server.

lustre/ost/ost_handler.c

index 2389655..35a5360 100644 (file)
@@ -289,9 +289,13 @@ out_bulk:
 out_local:
         OBD_FREE(local_nb, sizeof(*local_nb) * niocount);
 out:
-        if (rc)
+        if (rc) {
+                /* It's a lot of work to delay allocating the reply, and a lot
+                 * less work to just free it here. */
+                OBD_FREE(req->rq_repmsg, req->rq_replen);
+                req->rq_repmsg = NULL;
                 ptlrpc_error(req->rq_svc, req);
-        else
+        else
                 ptlrpc_reply(req->rq_svc, req);
         RETURN(rc);
 }
@@ -410,9 +414,11 @@ out_free:
         OBD_FREE(local_nb, niocount * sizeof(*local_nb));
 out:
         if (!reply_sent) {
-                if (rc)
+                if (rc) {
+                        OBD_FREE(req->rq_repmsg, req->rq_replen);
+                        req->rq_repmsg = NULL;
                         ptlrpc_error(req->rq_svc, req);
-                else
+                else
                         ptlrpc_reply(req->rq_svc, req);
         }
         return rc;