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

raid: don't remove an unconfigured base bdev



Also remove the redundant check from a caller of
_raid_bdev_remove_base_bdev().

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


Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarMateusz Kozlowski <mateusz.kozlowski@solidigm.com>
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
parent a6708553
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -2129,7 +2129,7 @@ _raid_bdev_remove_base_bdev(struct raid_base_bdev_info *base_info,

	assert(spdk_get_thread() == spdk_thread_get_app_thread());

	if (base_info->remove_scheduled) {
	if (base_info->remove_scheduled || !base_info->is_configured) {
		return -ENODEV;
	}

@@ -2435,12 +2435,12 @@ raid_bdev_process_finish_unquiesced(void *ctx, int status)
	}

	if (process->status != 0) {
		struct raid_base_bdev_info *target = process->target;

		if (target->is_configured && !target->remove_scheduled) {
			_raid_bdev_remove_base_bdev(target, raid_bdev_process_finish_target_removed, process);
			return;
		status = _raid_bdev_remove_base_bdev(process->target, raid_bdev_process_finish_target_removed,
						     process);
		if (status != 0) {
			raid_bdev_process_finish_target_removed(process, status);
		}
		return;
	}

	spdk_thread_send_msg(process->thread, _raid_bdev_process_finish_done, process);