Whamcloud - gitweb
LU-5633 ptlrpc: hold rq_lock when modify rq_flags 57/11957/2
authorNiu Yawei <yawei.niu@intel.com>
Wed, 17 Sep 2014 08:00:01 +0000 (04:00 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 25 Sep 2014 02:44:24 +0000 (02:44 +0000)
In after_reply(), take the rq_lock for changing the rq_resend.

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Change-Id: Id2025f0d5c6e7b0991f9ced031433a4d69dd1a16
Reviewed-on: http://review.whamcloud.com/11957
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/ptlrpc/client.c

index ddfc91b..505998c 100644 (file)
@@ -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 */