Whamcloud - gitweb
LU-12441 lnet: Detach rspt when md_threshold is infinite
[fs/lustre-release.git] / lnet / lnet / lib-msg.c
index 0c630f3..3fdc189 100644 (file)
@@ -832,10 +832,12 @@ lnet_msg_detach_md(struct lnet_msg *msg, int cpt, int status)
                lnet_eq_enqueue_event(md->md_eq, &msg->msg_ev);
        }
 
-       if (unlink) {
+       if (unlink || (md->md_refcount == 0 &&
+                      md->md_threshold == LNET_MD_THRESH_INF))
                lnet_detach_rsp_tracker(md, cpt);
+
+       if (unlink)
                lnet_md_unlink(md);
-       }
 
        msg->msg_md = NULL;
 }