summaryrefslogtreecommitdiffstats
path: root/src/H5PB.c
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2020-04-07 14:41:49 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2020-04-07 14:41:49 (GMT)
commit1137ffef6ab8bbc33c48014fdc60e00eeee518b6 (patch)
tree6b85bf1c423e85efbb5ef66e246bd8d5bac6bca9 /src/H5PB.c
parent8d6c1eca16e792d70aa568db23db9198214f1178 (diff)
downloadhdf5-1137ffef6ab8bbc33c48014fdc60e00eeee518b6.zip
hdf5-1137ffef6ab8bbc33c48014fdc60e00eeee518b6.tar.gz
hdf5-1137ffef6ab8bbc33c48014fdc60e00eeee518b6.tar.bz2
After adding a shadow page to the deferred free list, set the entry's
page number to 0 so that we cannot free it again by accident.
Diffstat (limited to 'src/H5PB.c')
-rw-r--r--src/H5PB.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/H5PB.c b/src/H5PB.c
index 6c42cf2..0855b09 100644
--- a/src/H5PB.c
+++ b/src/H5PB.c
@@ -1125,9 +1125,11 @@ shadow_idx_entry_remove(H5F_shared_t *shared, uint64_t page, bool only_mark)
if (entry == NULL)
return 0;
- if (shared->vfd_swmr_writer && entry->md_file_page_offset != 0 &&
- shadow_image_defer_free(shared, entry) != 0)
- return -1;
+ if (shared->vfd_swmr_writer && entry->md_file_page_offset != 0) {
+ if (shadow_image_defer_free(shared, entry) != 0)
+ return -1;
+ entry->md_file_page_offset = 0;
+ }
if (only_mark) {
entry->garbage = true;