Commit 40da9ab5 authored by Patrick Ohly's avatar Patrick Ohly Committed by Jim Harris
Browse files

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: default avatarPatrick Ohly <patrick.ohly@intel.com>
Reviewed-on: https://review.gerrithub.io/430547


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 43b335f9
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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);