diff options
author | Neil Fortner <nfortne2@hdfgroup.org> | 2011-10-13 23:10:50 (GMT) |
---|---|---|
committer | Neil Fortner <nfortne2@hdfgroup.org> | 2011-10-13 23:10:50 (GMT) |
commit | 56960ac85c40c3b08989ff776d2a69c6e79a6f09 (patch) | |
tree | bc1aeb7b0a4e8f9ee1d731524d904022b4f1e2d7 /src/H5Oainfo.c | |
parent | 1406da6362e460a6dc5a3882ec0f62dca159b9a5 (diff) | |
download | hdf5-56960ac85c40c3b08989ff776d2a69c6e79a6f09.zip hdf5-56960ac85c40c3b08989ff776d2a69c6e79a6f09.tar.gz hdf5-56960ac85c40c3b08989ff776d2a69c6e79a6f09.tar.bz2 |
[svn-r21556] Purpose: Fix bug in H5Ocopy
Description:
H5Ocopy could get confused when copying a named datatype containing an
attribute which used that named datatype as its datatype. This happened
because H5Ocopy would recurse into the attribute's datatype before the object
the attribute was in was fully copied (i.e. before the "post-copy" pass).
Modified H5Ocopy to avoid recursing before the post-copy step in this case.
Required many changes, including to how non-committed shared messages are
copied.
Tested: jam, koala, heiwa (h5committest); durandal
Diffstat (limited to 'src/H5Oainfo.c')
-rw-r--r-- | src/H5Oainfo.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/H5Oainfo.c b/src/H5Oainfo.c index 8ff9cf6..d4d3b2a 100644 --- a/src/H5Oainfo.c +++ b/src/H5Oainfo.c @@ -403,7 +403,7 @@ H5O_ainfo_pre_copy_file(H5F_t UNUSED *file_src, const void UNUSED *native_src, */ static void * H5O_ainfo_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, - hbool_t *recompute_size, H5O_copy_t *cpy_info, void UNUSED *udata, hid_t dxpl_id) + hbool_t UNUSED *recompute_size, H5O_copy_t *cpy_info, void UNUSED *udata, hid_t dxpl_id) { H5O_ainfo_t *ainfo_src = (H5O_ainfo_t *)mesg_src; H5O_ainfo_t *ainfo_dst = NULL; @@ -436,9 +436,6 @@ H5O_ainfo_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, /* Reset metadata tag */ H5_END_TAG(NULL); - - if((H5A_dense_copy_file_all(file_src, ainfo_src, file_dst, ainfo_dst, recompute_size, cpy_info, dxpl_id)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to create dense storage for attributes") } /* end if */ /* Set return value */ @@ -458,7 +455,7 @@ done: * * Purpose: Finish copying a message from between files. * We have to copy the values of a reference attribute in the - * post copy because H5O_post_copy_file() fails at the case that + * post copy because H5O_post_copy_file() fails in the case that * an object may have a reference attribute that points to the * object itself. * @@ -481,10 +478,10 @@ H5O_ainfo_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, HDassert(ainfo_src); if(H5F_addr_defined(ainfo_src->fheap_addr)) { - if ( H5A_dense_post_copy_file_all(src_oloc, ainfo_src, dst_oloc, - (H5O_ainfo_t *)mesg_dst, dxpl_id, cpy_info) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, FAIL, "can't copy attribute") - } + if(H5A_dense_post_copy_file_all(src_oloc, ainfo_src, dst_oloc, + (H5O_ainfo_t *)mesg_dst, dxpl_id, cpy_info) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, FAIL, "can't copy attribute") + } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) |