Whamcloud - gitweb
b=19529 Avoid deadlock for local client writes.
authorDmitry Zogin <dmitry.zoguine@oracle.com>
Thu, 5 Aug 2010 19:32:40 +0000 (23:32 +0400)
committerMikhail Pershin <tappro@sun.com>
Fri, 6 Aug 2010 19:24:39 +0000 (23:24 +0400)
  Check the OBD_BRW_MEMALLOC flag correctly in the remote buffer.

 i=andreas.dilger
 i=johann.lombardi

lustre/ost/ost_handler.c

index e2cde0b..b549391 100644 (file)
@@ -1037,10 +1037,6 @@ static int ost_brw_write(struct ptlrpc_request *req, struct obd_trans_info *oti)
         if (body == NULL)
                 GOTO(out, rc = -EFAULT);
 
         if (body == NULL)
                 GOTO(out, rc = -EFAULT);
 
-        if ((body->oa.o_flags & OBD_BRW_MEMALLOC) &&
-            (exp->exp_connection->c_peer.nid == exp->exp_connection->c_self))
-                cfs_memory_pressure_set();
-
         objcount = req_capsule_get_size(&req->rq_pill, &RMF_OBD_IOOBJ,
                                         RCL_CLIENT) / sizeof(*ioo);
         ioo = req_capsule_client_get(&req->rq_pill, &RMF_OBD_IOOBJ);
         objcount = req_capsule_get_size(&req->rq_pill, &RMF_OBD_IOOBJ,
                                         RCL_CLIENT) / sizeof(*ioo);
         ioo = req_capsule_client_get(&req->rq_pill, &RMF_OBD_IOOBJ);
@@ -1064,6 +1060,10 @@ static int ost_brw_write(struct ptlrpc_request *req, struct obd_trans_info *oti)
             &RMF_NIOBUF_REMOTE, RCL_CLIENT) / sizeof(*remote_nb)))
                 GOTO(out, rc = -EFAULT);
 
             &RMF_NIOBUF_REMOTE, RCL_CLIENT) / sizeof(*remote_nb)))
                 GOTO(out, rc = -EFAULT);
 
+        if ((remote_nb[0].flags & OBD_BRW_MEMALLOC) &&
+            (exp->exp_connection->c_peer.nid == exp->exp_connection->c_self))
+                cfs_memory_pressure_set();
+
         if (body->oa.o_valid & OBD_MD_FLOSSCAPA) {
                 capa = req_capsule_client_get(&req->rq_pill, &RMF_CAPA1);
                 if (capa == NULL) {
         if (body->oa.o_valid & OBD_MD_FLOSSCAPA) {
                 capa = req_capsule_client_get(&req->rq_pill, &RMF_CAPA1);
                 if (capa == NULL) {