Commit 7fbc5106 authored by wuzhouhui's avatar wuzhouhui Committed by Jim Harris
Browse files

reduce: put pmem_unmap() in _init_load_cleanup()



In effect, this commit fixes error path of spdk_reduce_vol_init()
and spdk_reduce_vol_load(): forget to unmap pmem file after mapped.

Change-Id: I797f15e315fff3ff42c17509a73dc46e7f6bdb24
Signed-off-by: default avatarwuzhouhui <wuzhouhui@kingsoft.com>
Reviewed-on: https://review.gerrithub.io/437270


Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent 84b5a8c1
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -314,6 +314,7 @@ _init_load_cleanup(struct spdk_reduce_vol *vol, struct reduce_init_load_ctx *ctx
	}

	if (vol != NULL) {
		pmem_unmap(vol->pm_file.pm_buf, vol->pm_file.size);
		spdk_dma_free(vol->backing_super);
		spdk_bit_array_free(&vol->allocated_chunk_maps);
		spdk_bit_array_free(&vol->allocated_backing_io_units);
@@ -673,8 +674,6 @@ spdk_reduce_vol_unload(struct spdk_reduce_vol *vol,
		return;
	}

	pmem_unmap(vol->pm_file.pm_buf, vol->pm_file.size);

	vol->backing_dev->close(vol->backing_dev);

	_init_load_cleanup(vol, NULL);