From a5a2ee70ebb50f04f6be75efd99b2c9545ba6690 Mon Sep 17 00:00:00 2001 From: Jinshan Xiong Date: Fri, 27 Jan 2012 12:04:46 -0800 Subject: [PATCH 3/3] LU-1044 ptlrpc: Fixed a swab race for ptlrpc ---- debug use only ---- Do hpreq check before the request is added into exp_hp_rpcs queue. Signed-off-by: Jinshan Xiong Change-Id: I87ef0252795ce8e25f6ba6e0643e52383a24bb6b --- lustre/ptlrpc/service.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lustre/ptlrpc/service.c b/lustre/ptlrpc/service.c index c893658..66ff9fc 100644 --- a/lustre/ptlrpc/service.c +++ b/lustre/ptlrpc/service.c @@ -1221,14 +1221,16 @@ static int ptlrpc_hpreq_init(struct ptlrpc_service *svc, RETURN(rc); } if (req->rq_export && req->rq_ops) { + /* Perform request specific check. We should do this check + * before the request is added into exp_hp_rpcs list otherwise + * it may hit swab race at LU-1044. */ + if (req->rq_ops->hpreq_check) + rc = req->rq_ops->hpreq_check(req); + cfs_spin_lock_bh(&req->rq_export->exp_rpc_lock); cfs_list_add(&req->rq_exp_list, &req->rq_export->exp_hp_rpcs); cfs_spin_unlock_bh(&req->rq_export->exp_rpc_lock); - - /* Perform request specific check. */ - if (req->rq_ops->hpreq_check) - rc = req->rq_ops->hpreq_check(req); } RETURN(rc); -- 1.7.6