summaryrefslogtreecommitdiffstats
path: root/rpc/rpc-transport/rdma/src/rdma.h
diff options
context:
space:
mode:
authorYi Wang <wangyi@storswift.com>2017-12-06 12:51:49 +0800
committerAmar Tumballi <amarts@redhat.com>2017-12-12 05:49:35 +0000
commit8483ed87165c1695b513e223549d33d2d63891d9 (patch)
tree43214304a1f7f83c780e4d7c93da626a5efb1f38 /rpc/rpc-transport/rdma/src/rdma.h
parentf9b6174a7f5eb6475ca9780b062bfb3ff1132b2d (diff)
rpc-transport/rdma: Add a mutex for the list of RDMA Memory Region(MR) access
Problem: gf_rdma_device_t->all_mr is a __gf_rdma_arena_mr(includes MR content) kind of list in the rdma rpc-transport. The rdma rpc-transport will add/delete items to the list when MRs register, deregister, and free. Because gf_rdma_device_t->all_mr is used by different threads and it is not mutex protected, rdma transport maybe access obsolete items in it. Solution: Add a mutex protection for the gf_rdma_device_t->all_mr. Change-Id: I2b7de0f7aa516b90bb6f3c6aae3aadd23b243900 BUG: 1522651 Signed-off-by: Yi Wang <wangyi@storswift.com>
Diffstat (limited to 'rpc/rpc-transport/rdma/src/rdma.h')
-rw-r--r--rpc/rpc-transport/rdma/src/rdma.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/rpc/rpc-transport/rdma/src/rdma.h b/rpc/rpc-transport/rdma/src/rdma.h
index 6bcf6bc6ef2..7ca0ead1f7a 100644
--- a/rpc/rpc-transport/rdma/src/rdma.h
+++ b/rpc/rpc-transport/rdma/src/rdma.h
@@ -326,6 +326,7 @@ struct __gf_rdma_device {
struct mem_pool *ioq_pool;
struct mem_pool *reply_info_pool;
struct list_head all_mr;
+ pthread_mutex_t all_mr_lock;
};
typedef struct __gf_rdma_device gf_rdma_device_t;