summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2020-08-28 17:51:39 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2020-08-28 17:51:39 (GMT)
commitb0e99604609fa054b914ff0638f3d6345b8e7774 (patch)
tree6495f38dcc545cf783410f3768ae0ae49b3d4b5a /src
parenta9d7f0d2ec1ee8e592d83005007c4cf547e4f2cb (diff)
parent0624ed2e480729e30dfc71aaf016f78c940c1316 (diff)
downloadhdf5-b0e99604609fa054b914ff0638f3d6345b8e7774.zip
hdf5-b0e99604609fa054b914ff0638f3d6345b8e7774.tar.gz
hdf5-b0e99604609fa054b914ff0638f3d6345b8e7774.tar.bz2
Merge branch 'feature/vfd_swmr' into multi
Diffstat (limited to 'src')
-rw-r--r--src/H5FDvfd_swmr.c2
-rw-r--r--src/H5Fsuper_cache.c33
2 files changed, 23 insertions, 12 deletions
diff --git a/src/H5FDvfd_swmr.c b/src/H5FDvfd_swmr.c
index 5322cf3..e2f8513 100644
--- a/src/H5FDvfd_swmr.c
+++ b/src/H5FDvfd_swmr.c
@@ -386,7 +386,7 @@ H5FD_vfd_swmr_open(const char *name, unsigned flags, hid_t fapl_id,
* before there is any file I/O when opening a file VFD SWMR reader,
* we need to be able to turn off sanity checking in the read function
* until the page buffer is enabled. This field exists for this
- * purpose, and should be remove when it is no longer necessary.
+ * purpose, and should be removed when it is no longer necessary.
*
* JRM -- 1/29/19
*/
diff --git a/src/H5Fsuper_cache.c b/src/H5Fsuper_cache.c
index 0ea9080..8af3932 100644
--- a/src/H5Fsuper_cache.c
+++ b/src/H5Fsuper_cache.c
@@ -1228,15 +1228,21 @@ H5F__cache_superblock_refresh(H5F_t *f, void * _thing, const void * _image,
if ( snode_btree_k != sblock->btree_k[H5B_SNODE_ID] )
HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "unexpected snode_btree_k")
- /* File status flags (not really used yet) */
- /* If the file has closed, the status flags will be zero.
- * Allow this.
+ /* File status flags (not really used yet)
+ *
+ * If the file has closed by the writer, then the status flags will
+ * change to zero. If the file was opened by the writer, then the
+ * status flags will change to
+ * H5F_SUPER_WRITE_ACCESS|H5F_SUPER_SWMR_WRITE_ACCESS. Only those
+ * two transitions are allowed.
*/
UINT32DECODE(image, status_flags);
- if (status_flags != sblock->status_flags && status_flags != 0) {
+ if (status_flags != sblock->status_flags && status_flags != 0 &&
+ status_flags !=
+ (H5F_SUPER_WRITE_ACCESS|H5F_SUPER_SWMR_WRITE_ACCESS)) {
HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL,
- "read status_flags %" PRIx32 " expected %" PRIx32,
- status_flags, sblock->status_flags)
+ "status_flags %" PRIx32 " unexpectedly changed to %" PRIx32,
+ sblock->status_flags, status_flags)
}
/*
@@ -1307,13 +1313,18 @@ H5F__cache_superblock_refresh(H5F_t *f, void * _thing, const void * _image,
/* File status flags (not really used yet) */
status_flags = *image++;
- /* If the file has closed, the status flags will be zero.
- * Allow this.
+ /* If the file has closed by the writer, then the status flags will
+ * change to zero. If the file was opened by the writer, then the
+ * status flags will change to
+ * H5F_SUPER_WRITE_ACCESS|H5F_SUPER_SWMR_WRITE_ACCESS. Only those
+ * two transitions are allowed.
*/
- if (status_flags != sblock->status_flags && status_flags != 0) {
+ if (status_flags != sblock->status_flags && status_flags != 0 &&
+ status_flags !=
+ (H5F_SUPER_WRITE_ACCESS|H5F_SUPER_SWMR_WRITE_ACCESS)) {
HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL,
- "read status_flags %" PRIx32 " expected %" PRIx32,
- status_flags, sblock->status_flags)
+ "status_flags %" PRIx32 " unexpectedly changed to %" PRIx32,
+ sblock->status_flags, status_flags)
}
/* Base, superblock extension, end of file & root group object