blobstore: Fix error path for snapshot creation

In _spdk_bs_snapshot_origblob_sync_cpl function on error
path we should not close snapshot as it will be closed during
volume closing when bs_dev is being destroyed.
This issue was found in unit test (see next patch in series).

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455215 (master)

(cherry picked from commit f27cbce428)
Change-Id: I51c38d1f1f97b134679251b43109b1265e565a17
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458589
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Maciej Szwed 2019-05-21 11:12:42 +02:00 committed by Darek Stojaczyk
parent 84b5ac7dac
commit f944a090e3

View File

@ -4505,7 +4505,7 @@ _spdk_bs_snapshot_origblob_sync_cpl(void *cb_arg, int bserrno)
if (bserrno != 0) {
_spdk_bs_snapshot_swap_cluster_maps(newblob, origblob);
_spdk_bs_clone_snapshot_newblob_cleanup(ctx, bserrno);
_spdk_bs_clone_snapshot_origblob_cleanup(ctx, bserrno);
return;
}