From 0c7c4ba490862a63eb28b7abe4a636a314fed9fa Mon Sep 17 00:00:00 2001 From: David Young Date: Fri, 28 Aug 2020 09:23:46 -0500 Subject: Fix a typo in a comment. NFCI. --- src/H5FDvfd_swmr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 */ -- cgit v0.12 From 0624ed2e480729e30dfc71aaf016f78c940c1316 Mon Sep 17 00:00:00 2001 From: David Young Date: Fri, 28 Aug 2020 12:49:40 -0500 Subject: 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. --- src/H5Fsuper_cache.c | 33 ++++++++++++++++++++++----------- 1 file 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 -- cgit v0.12