]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
msg/sync/rdma: abort rdma operation when ibv_query_device failed
authorChangcheng Liu <changcheng.liu@intel.com>
Thu, 25 Apr 2019 04:58:30 +0000 (12:58 +0800)
committerChangcheng Liu <changcheng.liu@intel.com>
Thu, 25 Apr 2019 06:07:50 +0000 (14:07 +0800)
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 <changcheng.liu@intel.com>
src/msg/async/rdma/Infiniband.cc

index 279d3bbb14f29ccea644dcc9f51a0c5e6087c974..ddbf5509f28f068bafbde9cfc478519323834158 100644 (file)
@@ -127,7 +127,7 @@ Device::Device(CephContext *cct, ibv_device* d, struct ibv_context *dc)
     ceph_abort();
   }
   int r = ibv_query_device(ctxt, device_attr);
-  if (r == -1) {
+  if (r) {
     lderr(cct) << __func__ << " failed to query rdma device. " << cpp_strerror(errno) << dendl;
     ceph_abort();
   }