Commit bad11eea authored by Artur Paszkiewicz's avatar Artur Paszkiewicz Committed by Jim Harris
Browse files

raid: keep raid bdev in CONFIGURING state when last base bdev is removed



When a raid bdev is created and there are none of the requested base
bdevs, it will be in CONFIGURING state with 0 discovered base bdevs,
waiting for the base bdevs to become available. So for consistency, when
a raid bdev is in CONFIGURING state with some discovered base bdevs,
don't delete the raid if those base bdevs are removed.

Signed-off-by: default avatarArtur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: Ieb8e47b777b03a0a1194ed6e4b4713fa46e70940
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/22932


Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
parent 2a1b861b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2129,7 +2129,8 @@ _raid_bdev_remove_base_bdev(struct raid_base_bdev_info *base_info,
		 */
		raid_bdev_free_base_bdev_resource(base_info);
		base_info->remove_scheduled = false;
		if (raid_bdev->num_base_bdevs_discovered == 0) {
		if (raid_bdev->num_base_bdevs_discovered == 0 &&
		    raid_bdev->state == RAID_BDEV_STATE_OFFLINE) {
			/* There is no base bdev for this raid, so free the raid device. */
			raid_bdev_cleanup_and_free(raid_bdev);
		}