summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2017-05-12 02:39:23 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2017-05-12 02:39:23 (GMT)
commit0adad7281356cd61f54cbdd286f855e1832c9c17 (patch)
treee9bc0ead5e8b18ef18f3367cfdc5293e1b59a63d /src
parent5e203972a98f48aeb4834a5bfa326717687fcd6f (diff)
parent1d786206df53942a3a3dbd538b369c94a632050d (diff)
downloadhdf5-0adad7281356cd61f54cbdd286f855e1832c9c17.zip
hdf5-0adad7281356cd61f54cbdd286f855e1832c9c17.tar.gz
hdf5-0adad7281356cd61f54cbdd286f855e1832c9c17.tar.bz2
Merge pull request #511 in HDFFV/hdf5 from ~DEROBINS/hdf5_der:h5do_overwrite_1_10 to hdf5_1_10
* commit '1d786206df53942a3a3dbd538b369c94a632050d': Removed redundant assignement. Fixes the chunk overwrite bug (HDFFV-10187) and adds a new H5DO HL test.
Diffstat (limited to 'src')
-rw-r--r--src/H5Dchunk.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c
index 2523c5d..f02c69f 100644
--- a/src/H5Dchunk.c
+++ b/src/H5Dchunk.c
@@ -445,11 +445,17 @@ H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters,
/* Set up the size of chunk for user data */
udata.chunk_block.length = data_size;
- /* Create the chunk it if it doesn't exist, or reallocate the chunk
- * if its size changed.
- */
- if(H5D__chunk_file_alloc(&idx_info, &old_chunk, &udata.chunk_block, &need_insert, scaled) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate chunk")
+ if (0 == idx_info.pline->nused && H5F_addr_defined(old_chunk.offset)) {
+ /* If there are no filters and we are overwriting the chunk we can just set values */
+ need_insert = FALSE;
+ }
+ else {
+ /* Otherwise, create the chunk it if it doesn't exist, or reallocate the chunk
+ * if its size has changed.
+ */
+ if (H5D__chunk_file_alloc(&idx_info, &old_chunk, &udata.chunk_block, &need_insert, scaled) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate chunk")
+ }
/* Make sure the address of the chunk is returned. */
if(!H5F_addr_defined(udata.chunk_block.offset))