summaryrefslogtreecommitdiffstats
path: root/src/H5FDvfd_swmr.c
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2020-07-10 20:23:38 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2020-07-10 20:23:38 (GMT)
commit03cdbe93763ef40bc9ed4b05f44e917f0c84c777 (patch)
treefcc001e2ac9a6afc6a92fa63f012d8cc4577221a /src/H5FDvfd_swmr.c
parentb030664aaa6be65ec4c1c18d958ba122edf3a867 (diff)
downloadhdf5-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.
Diffstat (limited to 'src/H5FDvfd_swmr.c')
-rw-r--r--src/H5FDvfd_swmr.c20
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 */