summaryrefslogtreecommitdiffstats
path: root/src/H5Oalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Oalloc.c')
-rw-r--r--src/H5Oalloc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c
index 4f98cfa..40c9c38 100644
--- a/src/H5Oalloc.c
+++ b/src/H5Oalloc.c
@@ -2023,6 +2023,7 @@ H5O_merge_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh)
/* Second message has been merged, delete it */
if(merged_msg) {
H5O_chunk_proxy_t *curr_chk_proxy; /* Chunk that message is in */
+ htri_t result;
/* Release any information/memory for second message */
H5O_msg_free_mesg(curr_msg2);
@@ -2050,6 +2051,13 @@ H5O_merge_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh)
/* (Don't bother reducing size of message array for now -QAK) */
oh->nmesgs--;
+ /* The merge null message might span the entire chunk: scan for empty chunk to remove */
+ if((result = H5O_remove_empty_chunks(f, dxpl_id, oh)) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTPACK, FAIL, "can't remove empty chunk")
+ else if(result > 0)
+ /* Get out of loop */
+ break;
+
/* If the merged message is too large, shrink the chunk */
if(curr_msg->raw_size >= H5O_MESG_MAX_SIZE)
if(H5O_alloc_shrink_chunk(f, dxpl_id, oh, curr_msg->chunkno) < 0)