From b4ea16c67955baec74a72080eb5d01531f732da9 Mon Sep 17 00:00:00 2001 From: rread Date: Mon, 19 Jul 2004 22:49:58 +0000 Subject: [PATCH] b=3886 A small races exists between receiving a reply and timeout. This diff prevents ptlrpc_expire_one_request from timing out a req that has already received the reply. --- lustre/ptlrpc/client.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lustre/ptlrpc/client.c b/lustre/ptlrpc/client.c index 5a4f9ae..fe9f627 100644 --- a/lustre/ptlrpc/client.c +++ b/lustre/ptlrpc/client.c @@ -811,14 +811,20 @@ int ptlrpc_expire_one_request(struct ptlrpc_request *req) { unsigned long flags; struct obd_import *imp = req->rq_import; + int replied = 0; ENTRY; - DEBUG_REQ(D_ERROR, req, "timeout"); - spin_lock_irqsave (&req->rq_lock, flags); - req->rq_timedout = 1; + replied = req->rq_replied; + if (!replied) + req->rq_timedout = 1; spin_unlock_irqrestore (&req->rq_lock, flags); + if (replied) + RETURN(0); + + DEBUG_REQ(D_ERROR, req, "timeout"); + ptlrpc_unregister_reply (req); if (req->rq_bulk != NULL) -- 1.8.3.1