Commit 51978c16 authored by Artur Paszkiewicz's avatar Artur Paszkiewicz Committed by Tomasz Zawadzki
Browse files

raid: fix creating an io channel during rebuild



When creating the channel, the "processed" twin of the channel
(raid_ch->process.ch_processed) didn't have ->module_channel set because
this was allocated after raid_bdev_ch_process_setup().

Fixes #3343

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


Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: default avatarMateusz Kozlowski <mateusz.kozlowski@solidigm.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 5b4e69ae
Loading
Loading
Loading
Loading
+8 −9
Original line number Diff line number Diff line
@@ -261,6 +261,14 @@ raid_bdev_create_cb(void *io_device, void *ctx_buf)
		}
	}

	if (raid_bdev->module->get_io_channel) {
		raid_ch->module_channel = raid_bdev->module->get_io_channel(raid_bdev);
		if (!raid_ch->module_channel) {
			SPDK_ERRLOG("Unable to create io channel for raid module\n");
			goto err;
		}
	}

	if (raid_bdev->process != NULL) {
		ret = raid_bdev_ch_process_setup(raid_ch, raid_bdev->process);
		if (ret != 0) {
@@ -272,18 +280,9 @@ raid_bdev_create_cb(void *io_device, void *ctx_buf)
	}
	spdk_spin_unlock(&raid_bdev->base_bdev_lock);

	if (raid_bdev->module->get_io_channel) {
		raid_ch->module_channel = raid_bdev->module->get_io_channel(raid_bdev);
		if (!raid_ch->module_channel) {
			SPDK_ERRLOG("Unable to create io channel for raid module\n");
			goto err_unlocked;
		}
	}

	return 0;
err:
	spdk_spin_unlock(&raid_bdev->base_bdev_lock);
err_unlocked:
	for (i = 0; i < raid_bdev->num_base_bdevs; i++) {
		if (raid_ch->base_channel[i] != NULL) {
			spdk_put_io_channel(raid_ch->base_channel[i]);