From: xie xingguo Date: Thu, 25 Feb 2016 11:03:49 +0000 (+0000) Subject: os/bluestore/NVMEDevice: fix error handling for try_get() X-Git-Tag: v10.1.0~266^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8abffb9aebcfbd46e444189713409f2a12e7773a;p=ceph.git os/bluestore/NVMEDevice: fix error handling for try_get() Signed-off-by: xie xingguo --- diff --git a/src/os/bluestore/NVMEDevice.cc b/src/os/bluestore/NVMEDevice.cc index bb95a4938d1d..73a959c9178e 100644 --- a/src/os/bluestore/NVMEDevice.cc +++ b/src/os/bluestore/NVMEDevice.cc @@ -503,7 +503,8 @@ int NVMEManager::try_get(const string &sn_tag, SharedDriverData **driver) ProbeContext ctx = {sn_tag, this, nullptr}; r = spdk_nvme_probe(&ctx, probe_cb, attach_cb); - if (r || !ctx.driver) { + if (r < 0) { + assert(!ctx.driver); derr << __func__ << " device probe nvme failed" << dendl; return r; }