>From 5112911cd2f70d11895e587c28cc4961814283e7 Mon Sep 17 00:00:00 2001 From: Mohammed Rafi KC Date: Fri, 6 Feb 2015 16:07:29 +0530 Subject: [PATCH] rdma:rdma post variable is not resetting the value. we are using a gf_rdma_post_t variable to transfer local address and other information to remote end. Once the I/O is over we put back this variable in a queue to reuse i for subsequent I/O's. So the counter variables will get increamented, and we are not resetting the when we put back the post in queue. There is chance for overflow of counter variables if we are not resetting it. Change-Id: I97505a1020dbf40067c33311b37cd5ddb2633ffd Signed-off-by: Mohammed Rafi KC --- rpc/rpc-transport/rdma/src/rdma.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/rpc/rpc-transport/rdma/src/rdma.c b/rpc/rpc-transport/rdma/src/rdma.c index a1c8622..668b576 100644 --- a/rpc/rpc-transport/rdma/src/rdma.c +++ b/rpc/rpc-transport/rdma/src/rdma.c @@ -64,8 +64,28 @@ gf_rdma_cm_handle_connect_init (struct rdma_cm_event *event); static void gf_rdma_put_post (gf_rdma_queue_t *queue, gf_rdma_post_t *post) { + gf_rdma_post_context_t *ctx = NULL; + int i = 0; + post->ctx.is_request = 0; + ctx = &post->ctx; + ctx->mr_count = 0; + ctx->count = 0; + ctx->iobref = NULL; + ctx->hdr_iobuf = NULL; + ctx->gf_rdma_reads = 0; + ctx->reply_info = NULL; + + for (i = 0; i < GF_RDMA_MAX_SEGMENTS; i++) { + ctx->mr[i] = NULL; + } + + for (i = 0; i < MAX_IOVEC; i++) { + ctx->vector[i].iov_base = NULL; + ctx->vector[i].iov_len = 0; + } + pthread_mutex_lock (&queue->lock); { if (post->prev) { -- 1.9.3