Skip to content
Snippets Groups Projects
Commit b4ea16c6 authored by Robert Read's avatar Robert Read
Browse files

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.
parent 4580a179
No related merge requests found
...@@ -811,14 +811,20 @@ int ptlrpc_expire_one_request(struct ptlrpc_request *req) ...@@ -811,14 +811,20 @@ int ptlrpc_expire_one_request(struct ptlrpc_request *req)
{ {
unsigned long flags; unsigned long flags;
struct obd_import *imp = req->rq_import; struct obd_import *imp = req->rq_import;
int replied = 0;
ENTRY; ENTRY;
DEBUG_REQ(D_ERROR, req, "timeout");
spin_lock_irqsave (&req->rq_lock, flags); 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); spin_unlock_irqrestore (&req->rq_lock, flags);
if (replied)
RETURN(0);
DEBUG_REQ(D_ERROR, req, "timeout");
ptlrpc_unregister_reply (req); ptlrpc_unregister_reply (req);
if (req->rq_bulk != NULL) if (req->rq_bulk != NULL)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment