From ce21db524525d675fbe45cb6a43b503f0e028854 Mon Sep 17 00:00:00 2001 From: Dmitry Zogin Date: Thu, 5 Aug 2010 23:32:40 +0400 Subject: [PATCH] b=19529 Avoid deadlock for local client writes. Check the OBD_BRW_MEMALLOC flag correctly in the remote buffer. i=andreas.dilger i=johann.lombardi --- lustre/ost/ost_handler.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lustre/ost/ost_handler.c b/lustre/ost/ost_handler.c index e2cde0b..b549391 100644 --- a/lustre/ost/ost_handler.c +++ b/lustre/ost/ost_handler.c @@ -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->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); @@ -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); + 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) { -- 1.8.3.1