Commit 5abe0ec8 authored by paul luse's avatar paul luse Committed by Jim Harris
Browse files

reduce: fix ordering bug



_allocate_bit_arrays() needs vol->backing_dev set which was being done
after the call.

Change-Id: Ic8c36c98aee94fbd8230273638011b948cd95675
Signed-off-by: default avatarpaul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/443048


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarwuzhouhui <wuzhouhui@kingsoft.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent b2402ec5
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -502,6 +502,8 @@ spdk_reduce_vol_init(struct spdk_reduce_vol_params *params,
	vol->backing_lba_per_io_unit = params->backing_io_unit_size / backing_dev->blocklen;
	memcpy(&vol->params, params, sizeof(*params));

	vol->backing_dev = backing_dev;

	rc = _allocate_bit_arrays(vol);
	if (rc != 0) {
		cb_fn(cb_arg, NULL, rc);
@@ -509,8 +511,6 @@ spdk_reduce_vol_init(struct spdk_reduce_vol_params *params,
		return;
	}

	vol->backing_dev = backing_dev;

	memcpy(vol->backing_super->signature, SPDK_REDUCE_SIGNATURE,
	       sizeof(vol->backing_super->signature));
	memcpy(&vol->backing_super->params, params, sizeof(*params));