From 62d3579ecb545a5514cde8c9b225dd621777cf4d Mon Sep 17 00:00:00 2001 From: Changcheng Liu Date: Wed, 10 Apr 2019 00:02:15 +0800 Subject: [PATCH 1/4] abort rdma operation when ibv_query_device failed ibv_query_device return none zero when failing to query rdma device. run ceph_abort in any case when ibv_query_device return none zero. Signed-off-by: Changcheng Liu diff --git a/src/msg/async/rdma/Infiniband.cc b/src/msg/async/rdma/Infiniband.cc index 858cdd1aa4..da32cdd107 100644 --- a/src/msg/async/rdma/Infiniband.cc +++ b/src/msg/async/rdma/Infiniband.cc @@ -126,8 +126,8 @@ Device::Device(CephContext *cct, ibv_device* d, struct ibv_context *dc) lderr(cct) << __func__ << " open rdma device failed. " << cpp_strerror(errno) << dendl; ceph_abort(); } - int r = ibv_query_device(ctxt, device_attr); - if (r == -1) { + int rst = ibv_query_device(ctxt, device_attr); + if (rst) { lderr(cct) << __func__ << " failed to query rdma device. " << cpp_strerror(errno) << dendl; ceph_abort(); } -- 2.17.1