From a497ee9b56143d2baabdbda28e1ceffb04673639 Mon Sep 17 00:00:00 2001 From: yidong0635 Date: Fri, 26 Feb 2021 11:51:37 +0800 Subject: [PATCH] splite/vbdev_split: Free base part bdev on the error path. spdk_bdev_part_base_construct_ext is called by spdk_bdev_part_base_construct. there's already an example if a base bdev is an abnormal case we need to do spdk_bdev_part_base_free to close the base bdev. From constructing a successful part base bdev util finishing vbdev_split_create. there're except failure cases to exit. if a bdev is open and when runs into bdev_unregister_unsafe, it's in an EBUSY state, bdev will not finished from the list. That spdk_io_device_unregister will no be executed in spdk_bdev_unregister. That a subsytem with it callback which is app_reactors_stop can't be finished. Signed-off-by: yidong0635 Change-Id: Idc156557f936da5f2618421ede2619f1f2e29c51 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6599 Community-CI: Broadcom CI Reviewed-by: Changpeng Liu Reviewed-by: Aleksey Marchuk Tested-by: SPDK CI Jenkins --- module/bdev/split/vbdev_split.c | 1 + 1 file changed, 1 insertion(+) diff --git a/module/bdev/split/vbdev_split.c b/module/bdev/split/vbdev_split.c index 93f7f6708..9ac8ebc5d 100644 --- a/module/bdev/split/vbdev_split.c +++ b/module/bdev/split/vbdev_split.c @@ -317,6 +317,7 @@ vbdev_split_create(struct spdk_vbdev_split_config *cfg) err: split_base_tailq = spdk_bdev_part_base_get_tailq(cfg->split_base); spdk_bdev_part_base_hotremove(cfg->split_base, split_base_tailq); + spdk_bdev_part_base_free(cfg->split_base); return rc; }