CDEBUG(D_NET, "Sending %d bytes to portal %d, xid %lld, offset %u\n",
len, portal, xid, offset);
+ percpu_ref_get(&ptlrpc_pending);
+
rc = LNetPut(self, *mdh, ack,
peer_id, portal, xid, offset, 0);
if (unlikely(rc != 0)) {
}
break;
}
+ percpu_ref_get(&ptlrpc_pending);
/* sanity.sh 224c: lets skip last md */
if (posted_md == desc->bd_md_max_brw - 1)
posted_md, rc);
break;
}
+ percpu_ref_get(&ptlrpc_pending);
/* About to let the network at it... */
rc = LNetMDAttach(me, md, LNET_UNLINK,
/* ...but the MD attach didn't succeed... */
request->rq_receiving_reply = 0;
spin_unlock(&request->rq_lock);
- GOTO(cleanup_me, rc = -ENOMEM);
- }
+ GOTO(cleanup_me, rc = -ENOMEM);
+ }
+ percpu_ref_get(&ptlrpc_pending);
- CDEBUG(D_NET, "Setup reply buffer: %u bytes, xid %llu"
- ", portal %u\n",
- request->rq_repbuf_len, request->rq_xid,
- request->rq_reply_portal);
- }
+ CDEBUG(D_NET,
+ "Setup reply buffer: %u bytes, xid %llu, portal %u\n",
+ request->rq_repbuf_len, request->rq_xid,
+ request->rq_reply_portal);
+ }
/* add references on request for request_out_callback */
ptlrpc_request_addref(request);
md.eq_handle = ptlrpc_eq;
rc = LNetMDAttach(me, md, LNET_UNLINK, &rqbd->rqbd_md_h);
- if (rc == 0)
+ if (rc == 0) {
+ percpu_ref_get(&ptlrpc_pending);
return 0;
+ }
- CERROR("LNetMDAttach failed: %d;\n", rc);
+ CERROR("ptlrpc: LNetMDAttach failed: rc = %d\n", rc);
LASSERT(rc == -ENOMEM);
LNetMEUnlink(me);
LASSERT(rc == 0);