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: wuzhouhui <wuzhouhui@kingsoft.com>
Reviewed-on: https://review.gerrithub.io/437270
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
wuzhouhui 2018-12-14 15:18:29 +08:00 committed by Jim Harris
parent 84b5a8c1d6
commit 7fbc5106e4

View File

@ -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);