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.
{
unsigned long flags;
struct obd_import *imp = req->rq_import;
{
unsigned long flags;
struct obd_import *imp = req->rq_import;
- DEBUG_REQ(D_ERROR, req, "timeout");
-
spin_lock_irqsave (&req->rq_lock, flags);
spin_lock_irqsave (&req->rq_lock, flags);
+ replied = req->rq_replied;
+ if (!replied)
+ req->rq_timedout = 1;
spin_unlock_irqrestore (&req->rq_lock, flags);
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)
ptlrpc_unregister_reply (req);
if (req->rq_bulk != NULL)