bdev/rbd: fix error handling after failed rados_connect

Small language fix. But more importantly, the missing return caused
crashes because the released handle was used for the following
rados_ioctx_create.

Change-Id: Ica5efc157b89fe957a55bdee476ee70e6ccc2568
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Reviewed-on: https://review.gerrithub.io/430547
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Patrick Ohly 2018-10-24 09:46:12 +02:00 committed by Jim Harris
parent 43b335f917
commit 40da9ab5e3

View File

@ -115,8 +115,9 @@ bdev_rados_context_init(const char *rbd_pool_name, rados_t *cluster,
ret = rados_connect(*cluster);
if (ret < 0) {
SPDK_ERRLOG("Failed to connect rbd_pool\n");
SPDK_ERRLOG("Failed to connect to rbd_pool\n");
rados_shutdown(*cluster);
return -1;
}
ret = rados_ioctx_create(*cluster, rbd_pool_name, io_ctx);