Skip to content
Snippets Groups Projects
Commit 5d64d119 authored by Eric Mei's avatar Eric Mei
Browse files

branch: b1_6

fix a race that early reply right after realy reply.
b=15178
Christopher Morrone, LLNL (original author)
r=nathan
r=ericm
parent 28844d37
No related branches found
No related tags found
No related merge requests found
...@@ -110,18 +110,26 @@ void reply_in_callback(lnet_event_t *ev) ...@@ -110,18 +110,26 @@ void reply_in_callback(lnet_event_t *ev)
/* Early reply */ /* Early reply */
DEBUG_REQ(D_ADAPTTO, req, DEBUG_REQ(D_ADAPTTO, req,
"Early reply received: mlen=%u offset=%d replen=%d " "Early reply received: mlen=%u offset=%d replen=%d "
"replied=%d", ev->mlength, ev->offset, req->rq_replen, "replied=%d unlinked=%d", ev->mlength, ev->offset,
req->rq_replied); req->rq_replen, req->rq_replied, ev->unlinked);
if (unlikely(ev->mlength != lustre_msg_early_size())) if (unlikely(ev->mlength != lustre_msg_early_size()))
CERROR("early reply sized %u, expect %u\n", CERROR("early reply sized %u, expect %u\n",
ev->mlength, lustre_msg_early_size()); ev->mlength, lustre_msg_early_size());
req->rq_early_count++; /* number received, client side */ req->rq_early_count++; /* number received, client side */
if (req->rq_replied) if (req->rq_replied) {
/* If we already got the real reply, ignore the early /* If we already got the real reply, then we need to
reply, but signal so we can unlink */ * check if lnet_finalize() unlinked the md. In that
* case, there will be no further callback of type
* LNET_EVENT_UNLINK.
*/
if (ev->unlinked)
req->rq_must_unlink = 0;
else
DEBUG_REQ(D_RPCTRACE, req, "unlinked in reply");
goto out_wake; goto out_wake;
}
req->rq_early = 1; req->rq_early = 1;
req->rq_nob_received = ev->mlength; req->rq_nob_received = ev->mlength;
/* repmsg points to early reply */ /* repmsg points to early reply */
......
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