summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVailin Choi <vchoi@jam.ad.hdfgroup.org>2017-05-12 04:32:07 (GMT)
committerVailin Choi <vchoi@jam.ad.hdfgroup.org>2017-05-12 04:32:07 (GMT)
commit839bbd544a8cf11184e0d8429778ebf45c522d10 (patch)
treeff27d094517c6e1c119f038babe853271fc69ffe /src
parent13a3f09a931539ff5606a586a9668ffbf749d40b (diff)
downloadhdf5-839bbd544a8cf11184e0d8429778ebf45c522d10.zip
hdf5-839bbd544a8cf11184e0d8429778ebf45c522d10.tar.gz
hdf5-839bbd544a8cf11184e0d8429778ebf45c522d10.tar.bz2
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.c6
-rw-r--r--src/H5Dpkg.h1
-rw-r--r--src/H5Dtest.c41
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