summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2017-05-12 03:31:57 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2017-05-12 03:31:57 (GMT)
commitf95ef72a5e9827dfa63e4722938a58a8c9d686c0 (patch)
tree2c07ed048f0f414dfb043152e4e27fa8a96ac324 /src
parenta23da99bdb166428a08fb2db579bf1a8052147b9 (diff)
downloadhdf5-f95ef72a5e9827dfa63e4722938a58a8c9d686c0.zip
hdf5-f95ef72a5e9827dfa63e4722938a58a8c9d686c0.tar.gz
hdf5-f95ef72a5e9827dfa63e4722938a58a8c9d686c0.tar.bz2
Merged HDFFV-10187 direct chunk overwrite bugfix to develop from 1.10 branch.
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))