summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2011-09-08 11:09:07 +0530
committerAnand Avati <avati@gluster.com>2011-09-07 23:30:15 -0700
commitf13289fe204d6f5f8136e8e2704488862b80383f (patch)
treedc906eecfbc982ce7b6a550280f6999a61445c69
parentd499cb8064f61b70bc37a7d6cbf0f0c3b219c342 (diff)
rdma: fix excessive logs
most of this resulted in taking a 'ref' on NULL iobuf. Change-Id: I14b3eedc93c65d8112d279f2bc72a1daec8b33b6 BUG: 2346 Reviewed-on: http://review.gluster.com/372 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
-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 9f005d91d..feccd4054 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 4de24cad1..c59410f4c 100644
--- a/rpc/rpc-transport/rdma/src/rdma.c
+++ b/rpc/rpc-transport/rdma/src/rdma.c
@@ -3046,7 +3046,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,
@@ -3177,7 +3178,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);
}