Whamcloud - gitweb
b=19529 Avoid deadlock for local client writes.
authorDmitry Zogin <dmitry.zoguine@oracle.com>
Thu, 8 Jul 2010 17:54:32 +0000 (13:54 -0400)
committerjohann <johann@granier.local>
Thu, 8 Jul 2010 20:32:21 +0000 (22:32 +0200)
Check the OBD_BRW_MEMALLOC flag correctly in the remote buffer.

 i=johann
 i=andreas.dilger

lustre/ost/ost_handler.c

index 3aba513..fcb1695 100644 (file)
@@ -934,10 +934,6 @@ static int ost_brw_write(struct ptlrpc_request *req, struct obd_trans_info *oti)
         body = lustre_msg_buf(req->rq_reqmsg, REQ_REC_OFF, sizeof(*body));
         LASSERT(body != NULL);
 
-        if ((body->oa.o_flags & OBD_BRW_MEMALLOC) &&
-            (exp->exp_connection->c_peer.nid == exp->exp_connection->c_self))
-                libcfs_memory_pressure_set();
-
         objcount = lustre_msg_buflen(req->rq_reqmsg, REQ_REC_OFF + 1) /
                    sizeof(*ioo);
         ioo = lustre_msg_buf(req->rq_reqmsg, REQ_REC_OFF + 1,
@@ -950,6 +946,10 @@ static int ost_brw_write(struct ptlrpc_request *req, struct obd_trans_info *oti)
                                    niocount * sizeof(*remote_nb));
         LASSERT(remote_nb != NULL);
 
+        if ((remote_nb[0].flags & OBD_BRW_MEMALLOC) &&
+            (exp->exp_connection->c_peer.nid == exp->exp_connection->c_self))
+                libcfs_memory_pressure_set();
+
         size[REPLY_REC_OFF + 1] = niocount * sizeof(*rcs);
         rc = lustre_pack_reply(req, 3, size, NULL);
         if (rc != 0)