summaryrefslogtreecommitdiffstats
path: root/src/H5Dchunk.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2017-05-12 04:26:06 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2017-05-12 04:26:06 (GMT)
commit5e60a0e10e167f9caa8de84100f22f47658f2cf2 (patch)
tree2c07ed048f0f414dfb043152e4e27fa8a96ac324 /src/H5Dchunk.c
parenta23da99bdb166428a08fb2db579bf1a8052147b9 (diff)
parentf95ef72a5e9827dfa63e4722938a58a8c9d686c0 (diff)
downloadhdf5-5e60a0e10e167f9caa8de84100f22f47658f2cf2.zip
hdf5-5e60a0e10e167f9caa8de84100f22f47658f2cf2.tar.gz
hdf5-5e60a0e10e167f9caa8de84100f22f47658f2cf2.tar.bz2
Merge pull request #512 in HDFFV/hdf5 from ~DEROBINS/hdf5_der:develop to develop
* commit 'f95ef72a5e9827dfa63e4722938a58a8c9d686c0': Merged HDFFV-10187 direct chunk overwrite bugfix to develop from 1.10 branch.
Diffstat (limited to 'src/H5Dchunk.c')
-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))