From: Niu Yawei Date: Wed, 17 Sep 2014 08:00:01 +0000 (-0400) Subject: LU-5633 ptlrpc: hold rq_lock when modify rq_flags X-Git-Tag: 2.6.53~12 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=bb340f259f68f4e77907ec75a9349181caf19764 LU-5633 ptlrpc: hold rq_lock when modify rq_flags In after_reply(), take the rq_lock for changing the rq_resend. Signed-off-by: Niu Yawei Change-Id: Id2025f0d5c6e7b0991f9ced031433a4d69dd1a16 Reviewed-on: http://review.whamcloud.com/11957 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Fan Yong Reviewed-by: Johann Lombardi Reviewed-by: Oleg Drokin --- diff --git a/lustre/ptlrpc/client.c b/lustre/ptlrpc/client.c index ddfc91b..505998c 100644 --- a/lustre/ptlrpc/client.c +++ b/lustre/ptlrpc/client.c @@ -1268,7 +1268,9 @@ static int after_reply(struct ptlrpc_request *req) time_t now = cfs_time_current_sec(); DEBUG_REQ(D_RPCTRACE, req, "Resending request on EINPROGRESS"); + spin_lock(&req->rq_lock); req->rq_resend = 1; + spin_unlock(&req->rq_lock); req->rq_nr_resend++; /* allocate new xid to avoid reply reconstruction */