From f42c00b5ec649c9502248c53a6ae06bf0f65e092 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Tue, 3 Jul 2018 21:09:19 -0500 Subject: Fix for HDFFV-10509 --- src/H5Dchunk.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index d45ced0..3ee3a82 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -2933,8 +2933,21 @@ H5D__chunk_lookup(const H5D_t *dset, const hsize_t *scaled, H5F_set_coll_md_read(idx_info.f, temp_cmr); #endif /* H5_HAVE_PARALLEL */ - /* Cache the information retrieved */ - H5D__chunk_cinfo_cache_update(&dset->shared->cache.chunk.last, udata); + /* + * Cache the information retrieved. + * + * Note that if we are writing to the dataset in parallel and filters + * are involved, we skip caching this information as it is highly likely + * that the chunk information will be invalidated as a result of the + * filter operation (e.g. the chunk gets re-allocated to a different + * address in the file and/or gets re-allocated with a different size). + * If we were to cache this information, subsequent reads/writes would + * retrieve the invalid information and cause a variety of issues. + */ +#ifdef H5_HAVE_PARALLEL + if ( !((H5F_INTENT(dset->oloc.file) & H5F_ACC_RDWR) && dset->shared->dcpl_cache.pline.nused) ) +#endif + H5D__chunk_cinfo_cache_update(&dset->shared->cache.chunk.last, udata); } /* end if */ } /* end else */ -- cgit v0.12