summaryrefslogtreecommitdiffstats
path: root/src/H5Dlayout.c
diff options
context:
space:
mode:
authorVailin Choi <vchoi@hdfgroup.org>2017-05-09 18:18:26 (GMT)
committerVailin Choi <vchoi@hdfgroup.org>2017-05-09 18:18:26 (GMT)
commite062a77e0e9e22f5d7c3ede4236e8992fd7daf8d (patch)
tree96e8363040cb1763aed02f099f4be9aa1ff37379 /src/H5Dlayout.c
parent850a5956c0bb171f59e3fd5f5b06a4a10329ecf6 (diff)
parentd436db6c6efdfe7e9dbe06a642715116ef0eb5e3 (diff)
downloadhdf5-e062a77e0e9e22f5d7c3ede4236e8992fd7daf8d.zip
hdf5-e062a77e0e9e22f5d7c3ede4236e8992fd7daf8d.tar.gz
hdf5-e062a77e0e9e22f5d7c3ede4236e8992fd7daf8d.tar.bz2
Merge pull request #494 in HDFFV/hdf5 from ~VCHOI/my_hdf5_fork:develop to develop
* commit 'd436db6c6efdfe7e9dbe06a642715116ef0eb5e3': Fix for the two issues reported in HDFFV-10051 Modifications made based on the review comments from pull request #494 Tested on moohan, mayll, kituo, platypus, ostrich, osx1010test, quail, emu. Fix for the two issues reported in HDFFV-10051: (1) Repeated open/close of a compact dataset fails due to the increment of ndims in the dataset structure for every open. --This is done only for chunked dataset via H5D__chunk_set_sizes(). (2) layout "dirty" flag for a compact dataset is not reset properly after flushing the data at dataset close. --Reset the "dirty" flag before flushing the message to the object header via H5O_msg_write(). Tested on moohan, kituo, platypus, ostrich, osx1010test, quail, emu.
Diffstat (limited to 'src/H5Dlayout.c')
-rw-r--r--src/H5Dlayout.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/H5Dlayout.c b/src/H5Dlayout.c
index c2fb5c2..ec18e86 100644
--- a/src/H5Dlayout.c
+++ b/src/H5Dlayout.c
@@ -593,6 +593,7 @@ herr_t
H5D__layout_oh_read(H5D_t *dataset, hid_t dxpl_id, hid_t dapl_id, H5P_genplist_t *plist)
{
htri_t msg_exists; /* Whether a particular type of message exists */
+ hbool_t layout_copied = FALSE; /* Flag to indicate that layout message was copied */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -622,6 +623,7 @@ H5D__layout_oh_read(H5D_t *dataset, hid_t dxpl_id, hid_t dapl_id, H5P_genplist_t
*/
if(NULL == H5O_msg_read(&(dataset->oloc), H5O_LAYOUT_ID, &(dataset->shared->layout), dxpl_id))
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to read data layout message")
+ layout_copied = TRUE;
/* Check for external file list message (which might not exist) */
if((msg_exists = H5O_msg_exists(&(dataset->oloc), H5O_EFL_ID, dxpl_id)) < 0)
@@ -655,10 +657,16 @@ H5D__layout_oh_read(H5D_t *dataset, hid_t dxpl_id, hid_t dapl_id, H5P_genplist_t
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set layout")
/* Set chunk sizes */
- if(H5D__chunk_set_sizes(dataset) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "unable to set chunk sizes")
+ if(H5D_CHUNKED == dataset->shared->layout.type) {
+ if(H5D__chunk_set_sizes(dataset) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "unable to set chunk sizes")
+ }
done:
+ if(ret_value < 0 && layout_copied) {
+ if(H5O_msg_reset(H5O_LAYOUT_ID, &dataset->shared->layout) < 0)
+ HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "unable to reset layout info")
+ }
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__layout_oh_read() */