summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2020-08-28 17:49:40 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2020-08-28 17:49:40 (GMT)
commit0624ed2e480729e30dfc71aaf016f78c940c1316 (patch)
tree3bc651a08986a76720840b795eb0beebbe6f8ff1
parent0c7c4ba490862a63eb28b7abe4a636a314fed9fa (diff)
downloadhdf5-0624ed2e480729e30dfc71aaf016f78c940c1316.zip
hdf5-0624ed2e480729e30dfc71aaf016f78c940c1316.tar.gz
hdf5-0624ed2e480729e30dfc71aaf016f78c940c1316.tar.bz2
Also accept transitions of the superblock status flags to
H5F_SUPER_WRITE_ACCESS|H5F_SUPER_SWMR_WRITE_ACCESS. This should fix the problem Dana's seeing on his test VM.
-rw-r--r--src/H5Fsuper_cache.c33
1 files changed, 22 insertions, 11 deletions
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