bdev/lvol: Validate lvs_bdev during dump info json

Change-Id: I16021ccd1fc6638dae977d0089f85895e60ceced
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/408530
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Ben Walker 2018-04-20 14:48:24 -07:00
parent df8a61c253
commit 3a5452d65d

View File

@ -600,6 +600,12 @@ vbdev_lvol_dump_info_json(void *ctx, struct spdk_json_write_ctx *w)
spdk_json_write_object_begin(w);
lvs_bdev = vbdev_get_lvs_bdev_by_lvs(lvol->lvol_store);
if (!lvs_bdev) {
SPDK_ERRLOG("No such lvol store found\n");
rc = -ENODEV;
goto end;
}
bdev = lvs_bdev->bdev;
spdk_uuid_fmt_lower(lvol_store_uuid, sizeof(lvol_store_uuid), &lvol->lvol_store->uuid);