aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre/lustre
diff options
context:
space:
mode:
authorAlexander Boyko <alexander_boyko@xyratex.com>2016-11-10 12:30:41 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-11-14 16:02:55 +0100
commit8d2dab899a98d03a4ae3bdf3b73a3827990aa2ad (patch)
treeb5b2fa25d80976ad2a2b26fe09a09394eebe7973 /drivers/staging/lustre/lustre
parentstaging: lustre: nrs: serialize executions of nrs_policy_stop (diff)
downloadlinux-dev-8d2dab899a98d03a4ae3bdf3b73a3827990aa2ad.tar.xz
linux-dev-8d2dab899a98d03a4ae3bdf3b73a3827990aa2ad.zip
staging: lustre: ptlrpc: race at req processing
Fix: 5c689e689baa ("staging/lustre/ptlrpc: race at req processing") decreased the race window, but does not remove it. Disable rq_resend right after MSG_REPLAY flag set. Import lock protects two threads from race between set/clear MSG_REPLAY and rq_resend flags. Signed-off-by: Alexander Boyko <alexander_boyko@xyratex.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5554 Xyratex-bug-id: MRP-1888 Reviewed-on: http://review.whamcloud.com/10735 Reviewed-by: Niu Yawei <yawei.niu@intel.com> Reviewed-by: Mike Pershin <mike.pershin@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/lustre')
-rw-r--r--drivers/staging/lustre/lustre/ptlrpc/client.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/staging/lustre/lustre/ptlrpc/client.c b/drivers/staging/lustre/lustre/ptlrpc/client.c
index bb7ae4e08902..afdc0df60154 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/client.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/client.c
@@ -2714,6 +2714,10 @@ void ptlrpc_retain_replayable_request(struct ptlrpc_request *req,
lustre_msg_add_flags(req->rq_reqmsg, MSG_REPLAY);
+ spin_lock(&req->rq_lock);
+ req->rq_resend = 0;
+ spin_unlock(&req->rq_lock);
+
LASSERT(imp->imp_replayable);
/* Balanced in ptlrpc_free_committed, usually. */
ptlrpc_request_addref(req);