summaryrefslogtreecommitdiffstats
path: root/src/H5PB.c
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2020-06-08 22:47:17 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2020-06-08 22:47:17 (GMT)
commit4351ad6c4e8c5ac527e2ccd5f91b3b2b9ad60002 (patch)
treec2dea45bc729c1c179491793ab6fc55e6206fe54 /src/H5PB.c
parent052257ec62dc977830ffb088f1ac2db3fa62d69f (diff)
downloadhdf5-4351ad6c4e8c5ac527e2ccd5f91b3b2b9ad60002.zip
hdf5-4351ad6c4e8c5ac527e2ccd5f91b3b2b9ad60002.tar.gz
hdf5-4351ad6c4e8c5ac527e2ccd5f91b3b2b9ad60002.tar.bz2
Only remove shadow-index entries in H5PB__evict_entry() if we're a
VFD SWMR writer, so that the reader does not lose track of the real shadow-index content.
Diffstat (limited to 'src/H5PB.c')
-rw-r--r--src/H5PB.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/H5PB.c b/src/H5PB.c
index 8ece8a3..b0aae86 100644
--- a/src/H5PB.c
+++ b/src/H5PB.c
@@ -1254,7 +1254,7 @@ H5PB_remove_entry(H5F_shared_t *shared, haddr_t addr)
HGOTO_ERROR(H5E_PAGEBUF, H5E_SYSTEM, FAIL, "forced eviction failed")
- assert(vfd_swmr_pageno_to_mdf_idx_entry(shared->mdf_idx, shared->mdf_idx_entries_used, page, false) == NULL);
+ assert(!shared->vfd_swmr_writer || vfd_swmr_pageno_to_mdf_idx_entry(shared->mdf_idx, shared->mdf_idx_entries_used, page, false) == NULL);
}
done:
@@ -2434,7 +2434,8 @@ H5PB__evict_entry(H5F_shared_t *shared, H5PB_entry_t *entry_ptr, bool force,
* the image will be bigger. So the shadow file will never see the
* entire image written, just the first page of the image.
*/
- if (shadow_idx_entry_remove(shared, entry_ptr->page, only_mark) == -1) {
+ if (shared->vfd_swmr_writer &&
+ shadow_idx_entry_remove(shared, entry_ptr->page, only_mark) == -1) {
HGOTO_ERROR(H5E_PAGEBUF, H5E_SYSTEM, FAIL,
"failed to remove shadow index entry")
}