bdev/rbd: Add the missing "rados_shutdown" call.

Add the missing rados_shutdown call in
bdev_rbd_init function.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I0222d2453d1547cfd735f15237eca124cbc23479
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7430
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: <dongx.yi@intel.com>
This commit is contained in:
Ziye Yang 2021-04-16 23:57:24 +08:00 committed by Jim Harris
parent 62b9210cc5
commit 741abc3c8b

View File

@ -191,7 +191,7 @@ static int
bdev_rbd_init(const char *user_id, const char *rbd_pool_name, const char *const *config,
const char *rbd_name, rbd_image_info_t *info)
{
int ret;
int ret = 0;
rados_t cluster = NULL;
rados_ioctx_t io_ctx = NULL;
rbd_image_t image = NULL;
@ -206,21 +206,18 @@ bdev_rbd_init(const char *user_id, const char *rbd_pool_name, const char *const
ret = rbd_open(io_ctx, rbd_name, &image, NULL);
if (ret < 0) {
SPDK_ERRLOG("Failed to open specified rbd device\n");
goto err;
goto end;
}
ret = rbd_stat(image, info, sizeof(*info));
rbd_close(image);
if (ret < 0) {
SPDK_ERRLOG("Failed to stat specified rbd device\n");
goto err;
}
rados_ioctx_destroy(io_ctx);
return 0;
err:
end:
rados_ioctx_destroy(io_ctx);
rados_shutdown(cluster);
return -1;
return ret;
}
static void