Skip to content

Commit

Permalink
Merge branch 'issue#4849_develop' of https://github.com/vchoi-hdfgrou…
Browse files Browse the repository at this point in the history
…p/hdf5 into issue#4849_develop
  • Loading branch information
vchoi-hdfgroup committed Oct 9, 2024
2 parents d58dbca + fdcc97e commit d49c906
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 32 deletions.
7 changes: 3 additions & 4 deletions src/H5Fint.c
Original file line number Diff line number Diff line change
Expand Up @@ -3793,9 +3793,9 @@ H5F__start_swmr_write(H5F_t *f)

/* Ensure that there's no old-style opened objects */
for (u = 0; u < grp_dset_count; u++) {
H5O_native_info_t ninfo;
H5O_loc_t *oloc;
uint8_t version;
H5O_native_info_t ninfo;
H5O_loc_t *oloc;
uint8_t version;

if (NULL == (oloc = H5O_get_loc(obj_ids[u])))
HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found");
Expand Down Expand Up @@ -3946,7 +3946,6 @@ H5F__start_swmr_write(H5F_t *f)
}
}


/* Mark superblock as dirty */
if (H5F_super_dirty(f) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, FAIL, "unable to mark superblock as dirty");
Expand Down
1 change: 0 additions & 1 deletion src/H5Oint.c
Original file line number Diff line number Diff line change
Expand Up @@ -2960,7 +2960,6 @@ H5O_has_chksum(const H5O_t *oh)
FUNC_LEAVE_NOAPI(H5O_SIZEOF_CHKSUM_OH(oh) > 0)
} /* end H5O_has_chksum() */


/*-------------------------------------------------------------------------
* Function: H5O_get_version_bound
*
Expand Down
2 changes: 1 addition & 1 deletion src/H5Oprivate.h
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,7 @@ H5_DLL uint8_t H5O_get_oh_version(const H5O_t *oh);
H5_DLL herr_t H5O_get_rc_and_type(const H5O_loc_t *oloc, unsigned *rc, H5O_type_t *otype);
H5_DLL H5AC_proxy_entry_t *H5O_get_proxy(const H5O_t *oh);
H5_DLL bool H5O_has_chksum(const H5O_t *oh);
H5_DLL herr_t H5O_get_version_bound(H5F_libver_t bound, uint8_t *version);
H5_DLL herr_t H5O_get_version_bound(H5F_libver_t bound, uint8_t *version);

/* Object header message routines */
H5_DLL herr_t H5O_msg_create(const H5O_loc_t *loc, unsigned type_id, unsigned mesg_flags,
Expand Down
18 changes: 9 additions & 9 deletions test/swmr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1555,7 +1555,7 @@ test_metadata_read_retry_info(hid_t in_fapl)
* Close the file
*
* (B) Open the file with write + non-latest-format (earliest, latest)
* --file has v3 superblock
* --file has v3 superblock
* Create a group in the file
* Create a chunked dataset "dataset2" in the group--keep it open
* Verify "dataset2" is using v1 btree indexing
Expand Down Expand Up @@ -1736,7 +1736,7 @@ test_start_swmr_write(hid_t in_fapl, bool new_format)
if (H5Pclose(file_fapl) < 0)
FAIL_STACK_ERROR;

/* Create a group */
/* Create a group */
if ((gid = H5Gcreate2(fid, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR;

Expand Down Expand Up @@ -1807,7 +1807,6 @@ test_start_swmr_write(hid_t in_fapl, bool new_format)
if (H5Fclose(fid) < 0)
TEST_ERROR;


/*
* Case D: when opening a file with (V110, latest)
*/
Expand Down Expand Up @@ -1840,7 +1839,6 @@ test_start_swmr_write(hid_t in_fapl, bool new_format)
if (H5Fclose(fid) < 0)
TEST_ERROR;


/*
* Case E: when opening a file with (V110, latest)
*/
Expand Down Expand Up @@ -2218,7 +2216,8 @@ test_err_start_swmr_write(hid_t in_fapl, bool new_format)
if (new_format) {
if (ret < 0)
TEST_ERROR;
} else if (ret >= 0)
}
else if (ret >= 0)
TEST_ERROR;

/* Should fail for a second call to enable SWMR writing mode */
Expand Down Expand Up @@ -2250,9 +2249,10 @@ test_err_start_swmr_write(hid_t in_fapl, bool new_format)
if (new_format) {
if (ret < 0)
TEST_ERROR;
} else if (ret >= 0)
}
else if (ret >= 0)
TEST_ERROR;

/* Re-open the same file */
if ((fid2 = H5Freopen(fid)) < 0)
FAIL_STACK_ERROR;
Expand Down Expand Up @@ -2292,7 +2292,8 @@ test_err_start_swmr_write(hid_t in_fapl, bool new_format)
if (new_format) {
if (ret < 0)
TEST_ERROR;
} else if (ret >= 0)
}
else if (ret >= 0)
TEST_ERROR;

/* Should fail to enable SWMR writing for fid2 */
Expand Down Expand Up @@ -2384,7 +2385,6 @@ test_err_start_swmr_write(hid_t in_fapl, bool new_format)

} /* not new */


/* Close the file access property list */
if (H5Pclose(fapl) < 0)
FAIL_STACK_ERROR;
Expand Down
34 changes: 17 additions & 17 deletions test/tfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -5649,18 +5649,18 @@ test_libver_bounds_real(H5F_libver_t libver_create, unsigned oh_vers_create, H5F
*
*-------------------------------------------------------------------------
*/
#define VFNAME "verbounds.h5"
#define VFNAME "verbounds.h5"
#define VERBDSNAME "dataset 1"
#define SPACE1_DIM1 3
static void
test_libver_bounds_open(void)
{
hid_t file = H5I_INVALID_HID; /* File ID */
hid_t space = H5I_INVALID_HID; /* Dataspace ID */
hid_t dset = H5I_INVALID_HID; /* Dataset ID */
hid_t fapl = H5I_INVALID_HID; /* File access property list ID */
hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list ID */
hsize_t dim[1] = {SPACE1_DIM1}; /* Dataset dimensions */
hid_t file = H5I_INVALID_HID; /* File ID */
hid_t space = H5I_INVALID_HID; /* Dataspace ID */
hid_t dset = H5I_INVALID_HID; /* Dataset ID */
hid_t fapl = H5I_INVALID_HID; /* File access property list ID */
hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list ID */
hsize_t dim[1] = {SPACE1_DIM1}; /* Dataset dimensions */
H5F_libver_t low, high; /* File format bounds */
hsize_t chunk_dim[1] = {SPACE1_DIM1}; /* Chunk dimensions */
bool vol_is_native;
Expand Down Expand Up @@ -5724,7 +5724,7 @@ test_libver_bounds_open(void)
CHECK(ret, FAIL, "H5Pset_libver_bounds");

if ((file = H5Fopen(VFNAME, H5F_ACC_RDONLY, fapl)) < 0)
VERIFY((file >= 0), true, "Attempt to open latest file with earliest version should succeed");
VERIFY((file >= 0), true, "Attempt to open latest file with earliest version should succeed");
ret = H5Fclose(file);
CHECK(ret, FAIL, "H5Fclose");

Expand All @@ -5747,7 +5747,7 @@ test_libver_bounds_open(void)

/* Open the file */
file = H5Fopen(VFNAME, H5F_ACC_RDONLY, fapl);
VERIFY(file >=0, true, "H5Fopen should succeed");
VERIFY(file >= 0, true, "H5Fopen should succeed");

ret = H5Fclose(file);
CHECK(ret, FAIL, "H5Fclose");
Expand Down Expand Up @@ -6334,16 +6334,16 @@ test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr, htri_t non

/* Get the internal file pointer if the open succeeds */
if (fid >= 0) {
ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");

} else {
ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
}
else {

VERIFY((is_swmr || (non_def_fsm && (high < H5F_LIBVER_V110))), true, "H5Fopen");
}

} /* end for */
} /* end for */
} /* end for */
} /* end for */

/* Close the file access property list */
ret = H5Pclose(new_fapl);
Expand Down Expand Up @@ -7601,8 +7601,8 @@ test_libver_bounds_attributes(hid_t fapl)
CHECK_PTR(attr, "H5VL_object");

/* Verify the attribute message version */
VERIFY(attr->shared->version >= H5O_attr_ver_bounds[f->shared->low_bound],
true, "H5O_attr_ver_bounds");
VERIFY(attr->shared->version >= H5O_attr_ver_bounds[f->shared->low_bound], true,
"H5O_attr_ver_bounds");

/* Close the attribute */
ret = H5Aclose(aid);
Expand Down

0 comments on commit d49c906

Please sign in to comment.