summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2010-10-29 03:13:22 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-10-29 03:42:22 -0700
commitffbe9470cd189b7921509c08c9b2d308b8ac390e (patch)
tree743f1da719e6cdbdbed0cfe0ea01fa8fdccb02b0
parent9c29312628af743f16badb4bc820cbd31f2a9488 (diff)
rpc-transport: fix race-condition between rdma-read completion and updating the count of number of vectors to be passed to rpc.
- If rdma read completes before incrementing the vector count, the count value sent to rpc will be improper. For fops like write, this may result in missing out a vector to be written, thereby causing data corruption. Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 1877 (data corruption while running arequal.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1877
-rw-r--r--rpc/rpc-transport/rdma/src/rdma.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/rpc/rpc-transport/rdma/src/rdma.c b/rpc/rpc-transport/rdma/src/rdma.c
index 6a95f92945b..63b1c2c257d 100644
--- a/rpc/rpc-transport/rdma/src/rdma.c
+++ b/rpc/rpc-transport/rdma/src/rdma.c
@@ -2931,6 +2931,7 @@ rdma_do_reads (rdma_peer_t *peer, rdma_post_t *post, rdma_read_chunk_t *readch)
}
post->ctx.rdma_reads = i;
+ post->ctx.count += post->ctx.rdma_reads;
if (size > peer->trans->ctx->page_size) {
gf_log (RDMA_LOG_NAME, GF_LOG_ERROR,
@@ -2980,7 +2981,6 @@ rdma_do_reads (rdma_peer_t *peer, rdma_post_t *post, rdma_read_chunk_t *readch)
goto unlock;
}
- post->ctx.count++;
ptr += readch[i].rc_target.rs_length;
}