summaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
Diffstat (limited to 'rpc')
-rw-r--r--rpc/rpc-lib/src/rpc-transport.c3
-rw-r--r--rpc/rpc-transport/rdma/src/rdma.c5
2 files changed, 5 insertions, 3 deletions
diff --git a/rpc/rpc-lib/src/rpc-transport.c b/rpc/rpc-lib/src/rpc-transport.c
index 3db73f652..0ad579bc3 100644
--- a/rpc/rpc-lib/src/rpc-transport.c
+++ b/rpc/rpc-lib/src/rpc-transport.c
@@ -556,7 +556,8 @@ rpc_transport_pollin_alloc (rpc_transport_t *this, struct iovec *vector,
msg->count = count;
msg->iobref = iobref_ref (iobref);
msg->private = private;
- msg->hdr_iobuf = iobuf_ref (hdr_iobuf);
+ if (hdr_iobuf)
+ msg->hdr_iobuf = iobuf_ref (hdr_iobuf);
out:
return msg;
diff --git a/rpc/rpc-transport/rdma/src/rdma.c b/rpc/rpc-transport/rdma/src/rdma.c
index c0b7e7bf2..fa2eb9e05 100644
--- a/rpc/rpc-transport/rdma/src/rdma.c
+++ b/rpc/rpc-transport/rdma/src/rdma.c
@@ -3047,7 +3047,8 @@ rdma_pollin_notify (rdma_peer_t *peer, rdma_post_t *post)
* because of server sending entire msg as inline without
* doing rdma writes.
*/
- iobref_add (post->ctx.iobref, post->ctx.hdr_iobuf);
+ if (post->ctx.hdr_iobuf)
+ iobref_add (post->ctx.iobref, post->ctx.hdr_iobuf);
}
pollin = rpc_transport_pollin_alloc (peer->trans,
@@ -3178,7 +3179,7 @@ rdma_recv_reply (rdma_peer_t *peer, rdma_post_t *post)
}
ctx = rpc_req->conn_private;
- if (post->ctx.iobref == NULL) {
+ if ((post->ctx.iobref == NULL) && ctx->rsp_iobref) {
post->ctx.iobref = iobref_ref (ctx->rsp_iobref);
}