summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/H5B.c14
-rw-r--r--src/H5B2hdr.c2
-rw-r--r--src/H5Dbtree.c2
-rw-r--r--test/swmr_sparse_reader.c2
-rw-r--r--test/swmr_sparse_writer.c7
5 files changed, 9 insertions, 18 deletions
diff --git a/src/H5B.c b/src/H5B.c
index cd50b36..36d901e 100644
--- a/src/H5B.c
+++ b/src/H5B.c
@@ -625,7 +625,7 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, unsigned idx,
unsigned i;
/*
- * We must clone the old btree so readers with an out-of-date version
+ * We must clone the old btree so readers with an out-of-date version
* of the parent can still see all its children, via the shadowed
* non-split bt. Remove it from cache but do not mark it free on disk.
*/
@@ -639,16 +639,14 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, unsigned idx,
HGOTO_ERROR(H5E_BTREE, H5E_CANTPIN, FAIL, "unable to pin old b-tree node")
bt_pinned = TRUE;
- /* Unprotect bt so we can move it. Also, note that it will be marked
- * dirty so it will be written to the new location. */
- HDassert(bt_ud->cache_flags & H5AC__DIRTIED_FLAG);
- if(H5AC_unprotect(f, dxpl_id, H5AC_BT, bt_ud->addr, bt_ud->bt, bt_ud->cache_flags) < 0)
+ /* Unprotect bt so we can move it. Do not mark it dirty yet so it is
+ * not flushed to the old location (however unlikely). */
+ if(H5AC_unprotect(f, dxpl_id, H5AC_BT, bt_ud->addr, bt_ud->bt, H5AC__NO_FLAGS_SET) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release old b-tree")
- bt_ud->cache_flags = H5AC__NO_FLAGS_SET;
/* Move the location of the old child on the disk */
if(H5AC_move_entry(f, H5AC_BT, bt_ud->addr, new_bt_addr) < 0)
- HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to move B-tree root node")
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTMOVE, FAIL, "unable to move B-tree node")
bt_ud->addr = new_bt_addr;
/* Re-protect bt at new address */
@@ -729,7 +727,7 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, unsigned idx,
} /* end if */
bt_ud->bt->right = split_bt_ud->addr;
- bt_ud->cache_flags |= H5AC__DIRTIED_FLAG;
+ HDassert(bt_ud->cache_flags & H5AC__DIRTIED_FLAG);
done:
if(ret_value < 0) {
diff --git a/src/H5B2hdr.c b/src/H5B2hdr.c
index c90b296..b73c29a 100644
--- a/src/H5B2hdr.c
+++ b/src/H5B2hdr.c
@@ -601,6 +601,6 @@ done:
if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_HDR, hdr->addr, hdr, cache_flags) < 0)
HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree header")
- FUNC_LEAVE_NOAPI(SUCCEED)
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B2_hdr_delete() */
diff --git a/src/H5Dbtree.c b/src/H5Dbtree.c
index eb6b2ac..57fdd8d 100644
--- a/src/H5Dbtree.c
+++ b/src/H5Dbtree.c
@@ -1619,7 +1619,7 @@ H5D_btree_idx_support(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata,
{
H5O_loc_t oloc; /* Temporary object header location for dataset */
H5O_t *oh = NULL; /* Dataset's object header */
- herr_t ret_value; /* Return value */
+ htri_t ret_value; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
diff --git a/test/swmr_sparse_reader.c b/test/swmr_sparse_reader.c
index 53bd877..dfed4dc 100644
--- a/test/swmr_sparse_reader.c
+++ b/test/swmr_sparse_reader.c
@@ -117,7 +117,6 @@ H5Pset_fclose_degree(fapl, H5F_CLOSE_SEMI);
/* Read records */
for(u = 0; u < nrecords; u++) {
symbol_info_t *symbol = NULL; /* Symbol (dataset) */
- int can_read; /* Boolean: whether we can read the dataset */
htri_t attr_exists; /* Whether the sequence number attribute exists */
unsigned long file_u; /* Attribute sequence number (writer's "u") */
@@ -129,7 +128,6 @@ H5Pset_fclose_degree(fapl, H5F_CLOSE_SEMI);
symbol->nrecords = nrecords / 5;
/* Wait until we can read the dataset */
- can_read = 0;
do {
/* Check if sequence attribute exists */
if((attr_exists = H5Aexists_by_name(fid, symbol->name, "seq", H5P_DEFAULT)) < 0)
diff --git a/test/swmr_sparse_writer.c b/test/swmr_sparse_writer.c
index 7af71ba..211bec9 100644
--- a/test/swmr_sparse_writer.c
+++ b/test/swmr_sparse_writer.c
@@ -142,16 +142,11 @@ add_records(hid_t fid, unsigned verbose, unsigned long nrecords, unsigned long f
/* Set the record's ID (equal to its position) */
record.rec_id = start;
- /* Extend the dataset's dataspace to hold the new record */
- symbol->nrecords++;
- if(H5Dset_extent(symbol->dsid, &symbol->nrecords) < 0)
- return(-1);
-
/* Get the dataset's dataspace */
if((file_sid = H5Dget_space(symbol->dsid)) < 0)
return(-1);
- /* Choose the last record in the dataset */
+ /* Choose a random record in the dataset */
if(H5Sselect_hyperslab(file_sid, H5S_SELECT_SET, &start, NULL, &count, NULL) < 0)
return(-1);