diff options
author | David Young <dyoung@hdfgroup.org> | 2020-07-10 20:23:38 (GMT) |
---|---|---|
committer | David Young <dyoung@hdfgroup.org> | 2020-07-10 20:23:38 (GMT) |
commit | 03cdbe93763ef40bc9ed4b05f44e917f0c84c777 (patch) | |
tree | fcc001e2ac9a6afc6a92fa63f012d8cc4577221a | |
parent | b030664aaa6be65ec4c1c18d958ba122edf3a867 (diff) | |
download | hdf5-03cdbe93763ef40bc9ed4b05f44e917f0c84c777.zip hdf5-03cdbe93763ef40bc9ed4b05f44e917f0c84c777.tar.gz hdf5-03cdbe93763ef40bc9ed4b05f44e917f0c84c777.tar.bz2 |
Straggler from previous commit: when closing the VFD SWMR virtual file, clear
the lower virtual file's `exc_owner` field. While I'm here, remove a
gratuitous assertion.
This is part of a changeset that helps us avoid creating multiple H5F_shared_t
for one file when virtual datasets are used with VFD SWMR. The old code for
deduplicating VFD SWMR H5F_shared_t instances did not work correctly with VFD
SWMR, so we'd end up with multiple H5F_shared_t all active on the same file.
-rw-r--r-- | src/H5FDvfd_swmr.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/H5FDvfd_swmr.c b/src/H5FDvfd_swmr.c index af633e3..ab80a82 100644 --- a/src/H5FDvfd_swmr.c +++ b/src/H5FDvfd_swmr.c @@ -406,8 +406,18 @@ H5FD_vfd_swmr_close(H5FD_t *_file) FUNC_ENTER_NOAPI_NOINIT - /* Sanity check */ - HDassert(file); + if (file->hdf5_file_lf != NULL) { + if (file->hdf5_file_lf->exc_owner != NULL) { + assert(file->hdf5_file_lf->exc_owner == &file->pub); + file->hdf5_file_lf->exc_owner = NULL; + } + + /* Close the underlying file */ + if (H5FD_close(file->hdf5_file_lf) < 0) + /* Push error, but keep going */ + HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, \ + "unable to close the HDF5 file") + } vfd_swmr_reader_did_increase_tick_to(0); @@ -421,12 +431,6 @@ H5FD_vfd_swmr_close(H5FD_t *_file) free(file->api_elapsed_ticks); } - /* Close the underlying file */ - if(file->hdf5_file_lf && H5FD_close(file->hdf5_file_lf) < 0) - /* Push error, but keep going */ - HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, \ - "unable to close the HDF5 file") - /* Close the metadata file */ if(file->md_fd >= 0 && HDclose(file->md_fd) < 0) /* Push error, but keep going */ |