Whamcloud - gitweb
Fix lost unlinked ev in reply_in_callback (Isaac)
authorgirish <girish>
Wed, 10 Dec 2008 17:51:43 +0000 (17:51 +0000)
committergirish <girish>
Wed, 10 Dec 2008 17:51:43 +0000 (17:51 +0000)
b=17052
i=nathan.rutman
i=eric.mei

lustre/ptlrpc/events.c

index 5e28f93..720268d 100644 (file)
@@ -110,11 +110,13 @@ void reply_in_callback(lnet_event_t *ev)
 
         req->rq_receiving_reply = 0;
         req->rq_early = 0;
+        if (ev->unlinked)
+                req->rq_must_unlink = 0;
 
         if (ev->status)
                 goto out_wake;
         if (ev->type == LNET_EVENT_UNLINK) {
-                req->rq_must_unlink = 0;
+                LASSERT(ev->unlinked);
                 DEBUG_REQ(D_RPCTRACE, req, "unlink");
                 goto out_wake;
         }
@@ -128,18 +130,10 @@ void reply_in_callback(lnet_event_t *ev)
                           req->rq_replen, req->rq_replied, ev->unlinked);
 
                 req->rq_early_count++; /* number received, client side */
-                if (req->rq_replied) {
-                        /* If we already got the real reply, then we need to
-                         * 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");
+
+                if (req->rq_replied)   /* already got the real reply */
                         goto out_wake;
-                }
+
                 req->rq_early = 1;
                 req->rq_reply_off = ev->offset;
                 req->rq_nob_received = ev->mlength;