From f55b98e7352166100444bdb925a6cc83ceba7eaf Mon Sep 17 00:00:00 2001 From: Dmitry Zogin Date: Thu, 8 Jul 2010 13:54:32 -0400 Subject: [PATCH] b=19529 Avoid deadlock for local client writes. Check the OBD_BRW_MEMALLOC flag correctly in the remote buffer. i=johann i=andreas.dilger --- 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 3aba513..fcb1695 100644 --- a/lustre/ost/ost_handler.c +++ b/lustre/ost/ost_handler.c @@ -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) -- 1.8.3.1