diff options
author | Vailin Choi <vchoi@hdfgroup.org> | 2017-05-16 14:52:56 (GMT) |
---|---|---|
committer | Vailin Choi <vchoi@hdfgroup.org> | 2017-05-16 14:52:56 (GMT) |
commit | f5ee10c94f9c178393cca8c560ec73991159aa9f (patch) | |
tree | cf48d18dd6ab0f2255be8cc70f62c41eba3d0580 /src | |
parent | 0eb6ddd67bac805f431436c11231c0deedf82669 (diff) | |
parent | 839bbd544a8cf11184e0d8429778ebf45c522d10 (diff) | |
download | hdf5-f5ee10c94f9c178393cca8c560ec73991159aa9f.zip hdf5-f5ee10c94f9c178393cca8c560ec73991159aa9f.tar.gz hdf5-f5ee10c94f9c178393cca8c560ec73991159aa9f.tar.bz2 |
Merge pull request #513 in HDFFV/hdf5 from ~VCHOI/my_hdf5_fork:hdf5_1_8 to hdf5_1_8
* commit '839bbd544a8cf11184e0d8429778ebf45c522d10':
Fix for HDFFV-10051 Fix for issue #2 reported in HDFFV-10051: The layout "dirty" flag for a compact dataset is not reset properly after flusing the data at dataset close. --Reset the "dirty" flag before flushing the message. Issue #1 reported in HDFFV-10051 is not a problem for 1.8.
Diffstat (limited to 'src')
-rw-r--r-- | src/H5Dcompact.c | 6 | ||||
-rw-r--r-- | src/H5Dpkg.h | 1 | ||||
-rw-r--r-- | src/H5Dtest.c | 41 |
3 files changed, 46 insertions, 2 deletions
diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index 826daad..49c28a6 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -373,9 +373,11 @@ H5D__compact_flush(H5D_t *dset, hid_t dxpl_id) /* Check if the buffered compact information is dirty */ if(dset->shared->layout.storage.u.compact.dirty) { - if(H5O_msg_write(&(dset->oloc), H5O_LAYOUT_ID, 0, H5O_UPDATE_TIME, &(dset->shared->layout), dxpl_id) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to update layout message") dset->shared->layout.storage.u.compact.dirty = FALSE; + if(H5O_msg_write(&(dset->oloc), H5O_LAYOUT_ID, 0, H5O_UPDATE_TIME, &(dset->shared->layout), dxpl_id) < 0) { + dset->shared->layout.storage.u.compact.dirty = TRUE; + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to update layout message") + } } /* end if */ done: diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index 91cf5f3..13d7284 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -714,6 +714,7 @@ H5_DLL htri_t H5D__mpio_opt_possible(const H5D_io_info_t *io_info, #ifdef H5D_TESTING H5_DLL herr_t H5D__layout_version_test(hid_t did, unsigned *version); H5_DLL herr_t H5D__layout_contig_size_test(hid_t did, hsize_t *size); +H5_DLL herr_t H5D__layout_compact_dirty_test(hid_t did, hbool_t *dirty); H5_DLL herr_t H5D__current_cache_size_test(hid_t did, size_t *nbytes_used, int *nused); #endif /* H5D_TESTING */ diff --git a/src/H5Dtest.c b/src/H5Dtest.c index eef3c91..2e62a75 100644 --- a/src/H5Dtest.c +++ b/src/H5Dtest.c @@ -144,6 +144,47 @@ done: /*-------------------------------------------------------------------------- NAME + H5D__layout_compact_dirty_test + PURPOSE + Determine the "dirty" flag of a compact layout for a dataset's layout information + USAGE + herr_t H5D__layout_compact_dirty_test(did, dirty) + hid_t did; IN: Dataset to query + hbool_t *dirty; OUT: Pointer to location to place "dirty" info + RETURNS + Non-negative on success, negative on failure + DESCRIPTION + Checks the "dirty" flag of a compact dataset. + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + DO NOT USE THIS FUNCTION FOR ANYTHING EXCEPT TESTING + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +herr_t +H5D__layout_compact_dirty_test(hid_t did, hbool_t *dirty) +{ + H5D_t *dset; /* Pointer to dataset to query */ + herr_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_PACKAGE + + /* Check args */ + if(NULL == (dset = (H5D_t *)H5I_object_verify(did, H5I_DATASET))) + HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "not a dataset") + + if(dirty) { + HDassert(dset->shared->layout.type == H5D_COMPACT); + *dirty = dset->shared->layout.storage.u.compact.dirty; + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5D__layout_compact_dirty_test() */ + + +/*-------------------------------------------------------------------------- + NAME H5D__current_cache_size_test PURPOSE Determine current the size of the dataset's chunk cache |