diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2004-07-14 19:08:37 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2004-07-14 19:08:37 (GMT) |
commit | f0fe9b0114591c13051ccc92a2fca81b1ec3ca95 (patch) | |
tree | 4e4beea3de3cb398a8a7eadf4fd8bc4ab9e52b35 /src/H5Gnode.c | |
parent | b67740452b0c2ed1e287449ae3a871cb1ebccec7 (diff) | |
download | hdf5-f0fe9b0114591c13051ccc92a2fca81b1ec3ca95.zip hdf5-f0fe9b0114591c13051ccc92a2fca81b1ec3ca95.tar.gz hdf5-f0fe9b0114591c13051ccc92a2fca81b1ec3ca95.tar.bz2 |
[svn-r8875] Purpose:
Bug fix
Description:
Correct problems with "resurrecting" a dataset in a file. (This occurs
when a dataset which is open gets unlinked from the group hierarchy (making it
"dead" and marked for deletion in the file) and then is re-linked to the group
hierarchy). Note that the current solution applies only to datasets, further
work will fix this for groups and named datatypes also.
Also, fix the "debug" routines to be a little more helpful in certain
situations.
Additionally, fix a locking bug in the symbol table node splitting routine
which could be [one of] the cause[s] of the file corruption in flexible
parallel operation.
Platforms tested:
FreeBSD 4.10 (sleipnir) w/parallel
h5committested
Diffstat (limited to 'src/H5Gnode.c')
-rw-r--r-- | src/H5Gnode.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/H5Gnode.c b/src/H5Gnode.c index 5009b2c..851de13 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -1048,7 +1048,8 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void UNUSED *_lt_key, if (H5G_node_create(f, dxpl_id, H5B_INS_FIRST, NULL, NULL, NULL, new_node_p/*out*/)<0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, H5B_INS_ERROR, "unable to split symbol table node"); - if (NULL==(snrt=H5AC_find(f, dxpl_id, H5AC_SNODE, *new_node_p, NULL, NULL))) + + if (NULL == (snrt = H5AC_protect(f, dxpl_id, H5AC_SNODE, *new_node_p, NULL, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_INS_ERROR, "unable to split symbol table node"); HDmemcpy(snrt->entry, sn->entry + H5F_SYM_LEAF_K(f), @@ -1078,7 +1079,6 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void UNUSED *_lt_key, *rt_key_changed = TRUE; } } - } else { /* Where to insert the new entry? */ ret_value = H5B_INS_NOOP; @@ -1099,7 +1099,9 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void UNUSED *_lt_key, insert_into->nsyms += 1; done: - if (sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, FALSE) < 0 && ret_value!=H5B_INS_ERROR) + if (snrt && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, *new_node_p, snrt, FALSE) < 0) + HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5B_INS_ERROR, "unable to release symbol table node"); + if (sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, FALSE) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5B_INS_ERROR, "unable to release symbol table node"); FUNC_LEAVE_NOAPI(ret_value); @@ -1729,17 +1731,21 @@ H5G_node_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, fwidth = MAX(0, fwidth - 3); for (i = 0; i < sn->nsyms; i++) { fprintf(stream, "%*sSymbol %d:\n", indent - 3, "", i); - if (H5F_addr_defined(heap) && + if (heap>0 && H5F_addr_defined(heap) && (s = H5HL_peek(f, dxpl_id, heap, sn->entry[i].name_off))) { fprintf(stream, "%*s%-*s `%s'\n", indent, "", fwidth, "Name:", s); } + else + fprintf(stream, "%*s%-*s\n", indent, "", fwidth, "Warning: Invalid heap address given, name not displayed!"); + H5G_ent_debug(f, dxpl_id, sn->entry + i, stream, indent, fwidth, heap); } - H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, FALSE); - done: + if (sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, FALSE) < 0) + HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to release symbol table node"); + FUNC_LEAVE_NOAPI(ret_value); } |