bdev/split: Fix orphan'ed config when removing the base bdev first
When we create a base bdev and then create a split vbdev on top of the base bdev, if we delete the base bdev first, we have no way to remove the configuration of the split vbdev. Hence even if we create a base bdev again, we cannot create any split vbdev on top of the base bdev again. The meaning of flag, `removed` of `struct spdk_vbdev_split_config` is not clear and there will be no issue even if the flag `removed`. Hence remove the flag `removed` in this patch. Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Change-Id: I053c95e647721004cecfe4fd8b0f1ff5bb9bf38a Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460580 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>
This commit is contained in:
parent
8316dda159
commit
457afd77b1
@ -55,7 +55,6 @@ struct spdk_vbdev_split_config {
|
||||
|
||||
SPDK_BDEV_PART_TAILQ splits;
|
||||
struct spdk_bdev_part_base *split_base;
|
||||
bool removed;
|
||||
|
||||
TAILQ_ENTRY(spdk_vbdev_split_config) tailq;
|
||||
};
|
||||
@ -102,10 +101,7 @@ vbdev_split_base_free(void *ctx)
|
||||
{
|
||||
struct spdk_vbdev_split_config *cfg = ctx;
|
||||
|
||||
cfg->split_base = NULL;
|
||||
if (cfg->removed) {
|
||||
vbdev_split_del_config(cfg);
|
||||
}
|
||||
vbdev_split_del_config(cfg);
|
||||
}
|
||||
|
||||
static int
|
||||
@ -294,7 +290,6 @@ vbdev_split_create(struct spdk_vbdev_split_config *cfg)
|
||||
return 0;
|
||||
err:
|
||||
split_base_tailq = spdk_bdev_part_base_get_tailq(cfg->split_base);
|
||||
cfg->removed = true;
|
||||
spdk_bdev_part_base_hotremove(cfg->split_base, split_base_tailq);
|
||||
return rc;
|
||||
}
|
||||
@ -312,7 +307,6 @@ vbdev_split_destruct_config(struct spdk_vbdev_split_config *cfg)
|
||||
{
|
||||
struct bdev_part_tailq *split_base_tailq;
|
||||
|
||||
cfg->removed = true;
|
||||
if (cfg->split_base != NULL) {
|
||||
split_base_tailq = spdk_bdev_part_base_get_tailq(cfg->split_base);
|
||||
spdk_bdev_part_base_hotremove(cfg->split_base, split_base_tailq);
|
||||
@ -468,7 +462,7 @@ vbdev_split_examine(struct spdk_bdev *bdev)
|
||||
{
|
||||
struct spdk_vbdev_split_config *cfg = vbdev_split_config_find_by_base_name(bdev->name);
|
||||
|
||||
if (cfg != NULL && cfg->removed == false) {
|
||||
if (cfg != NULL) {
|
||||
assert(cfg->split_base == NULL);
|
||||
|
||||
if (vbdev_split_create(cfg)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user