summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorvchoi <vchoi@jelly.ad.hdfgroup.org>2021-12-21 18:25:32 (GMT)
committervchoi <vchoi@jelly.ad.hdfgroup.org>2021-12-21 18:25:32 (GMT)
commitcdc93ea7faa30084c6399b1a7cc5347e5654f860 (patch)
treee7f98fb474120199dd06207a81d581da281b8e82 /src
parenta30ca5afcd9f2e35b3a37f74286a6fe264b946f2 (diff)
downloadhdf5-cdc93ea7faa30084c6399b1a7cc5347e5654f860.zip
hdf5-cdc93ea7faa30084c6399b1a7cc5347e5654f860.tar.gz
hdf5-cdc93ea7faa30084c6399b1a7cc5347e5654f860.tar.bz2
Address issue #1 and issue #3 of the group test failures.
See Kent's documentation "Designed to Fail Tests and Issues". (A) Fix for issue #1: HDassert the < and = cases between old and new entry length. John will take care of the > case. (B) Fix for issue #3: set the cache copy of page_size again if different from f->shared->fs_page_size.
Diffstat (limited to 'src')
-rw-r--r--src/H5AC.c31
-rw-r--r--src/H5ACprivate.h1
-rw-r--r--src/H5Fvfd_swmr.c25
3 files changed, 56 insertions, 1 deletions
diff --git a/src/H5AC.c b/src/H5AC.c
index c913805..7e1f19b 100644
--- a/src/H5AC.c
+++ b/src/H5AC.c
@@ -2777,3 +2777,34 @@ H5AC_get_mdc_image_info(const H5AC_t *cache_ptr, haddr_t *image_addr, hsize_t *i
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_get_mdc_image_info() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5AC_set_vfd_swmr_reader
+ *
+ * Purpose: Wrapper function for H5C_set_vfd_swmr_reader().
+ *
+ * Return: SUCCEED on success, and FAIL on failure.
+ *
+ * Programmer: Vailin Choi; Dec 2021
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5AC_set_vfd_swmr_reader(H5AC_t *cache_ptr, hbool_t vfd_swmr_reader, hsize_t page_size)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Sanity checks */
+ HDassert(cache_ptr);
+
+ if(cache_ptr->page_size != page_size) {
+
+ if (H5C_set_vfd_swmr_reader((H5C_t *)cache_ptr, vfd_swmr_reader, page_size) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't set page_size for VFD SWMR reader")
+ }
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5AC_set_vfd_swmr_reader() */
diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h
index f7bed0c..ff632d0 100644
--- a/src/H5ACprivate.h
+++ b/src/H5ACprivate.h
@@ -433,6 +433,7 @@ H5_DLL herr_t H5AC_unsettle_ring(H5F_t *f, H5AC_ring_t ring);
H5_DLL herr_t H5AC_expunge_tag_type_metadata(H5F_t *f, haddr_t tag, int type_id, unsigned flags,
hbool_t type_match);
H5_DLL herr_t H5AC_get_tag(const void *thing, /*OUT*/ haddr_t *tag);
+H5_DLL herr_t H5AC_set_vfd_swmr_reader(H5AC_t *cache_ptr, hbool_t vfd_swmr_reader, hsize_t page_size);
/* Virtual entry routines */
H5_DLL H5AC_proxy_entry_t *H5AC_proxy_entry_create(void);
diff --git a/src/H5Fvfd_swmr.c b/src/H5Fvfd_swmr.c
index 43567ac..1a8f127 100644
--- a/src/H5Fvfd_swmr.c
+++ b/src/H5Fvfd_swmr.c
@@ -169,7 +169,7 @@ H5FL_DEFINE(eot_queue_entry_t);
* Return: Success: SUCCEED
* Failure: FAIL
*
- * Programmer: Vailin Choi -- 11/??/18
+ * Programmer: Vailin Choi -- 10/??/18
*
* Changes: None.
*
@@ -252,6 +252,21 @@ H5F_vfd_swmr_init(H5F_t *f, hbool_t file_create)
HDassert(!shared->vfd_swmr_config.writer);
+ HDassert(shared->fs_page_size > 0);
+ /* This is a bug uncovered by issue #3 of the group test failures.
+ * See Kent's documentation "Designed to Fail Tests and Issues".
+ * The file opening process in H5F__new() initializes the cache copy of
+ * page_size via H5AC_create(). However, later on H5F__super_read()
+ * may change page size due to non-default setting of
+ * 'free-space manager info' in superblock extension.
+ * Fix: set the cache copy of page_size again if different from
+ * f->shared->fs_page_size.
+ */
+ if(shared->cache) {
+ if (H5AC_set_vfd_swmr_reader(shared->cache, TRUE, shared->fs_page_size) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't set page size in cache for VFD SWMR reader");
+ }
+
shared->vfd_swmr_writer = FALSE;
shared->max_jump_ticks = 0;
@@ -1258,6 +1273,14 @@ H5F_vfd_swmr_reader_end_of_tick(H5F_t *f, hbool_t entering_api)
#if 0 /*Kent*/
HDassert(oent->length == nent->length);
#endif
+ /* This is a bug uncovered by issue #1 of the
+ * group test failures. See Kent's documentation
+ * "Designed to Fail Tests and Issues".
+ * nent->length can be <, =, > to oent->length.
+ * Fix: HDassert the 1st two cases: < and =.
+ * John will address the > case.
+ */
+ HDassert(nent->length <= oent->length);
/* the page has been altered -- evict it and
* any contained metadata cache entries.