diff options
author | Neil Fortner <nfortne2@hdfgroup.org> | 2011-10-14 00:03:09 (GMT) |
---|---|---|
committer | Neil Fortner <nfortne2@hdfgroup.org> | 2011-10-14 00:03:09 (GMT) |
commit | 363988bd77243b36c6324734b3a985c4fe07f650 (patch) | |
tree | fb23cc6accc028589d934362d56fad83a7e3b947 /src/H5Omessage.c | |
parent | 682a4f2b5d383d6abf6741a4a5a573f1c67e668e (diff) | |
download | hdf5-363988bd77243b36c6324734b3a985c4fe07f650.zip hdf5-363988bd77243b36c6324734b3a985c4fe07f650.tar.gz hdf5-363988bd77243b36c6324734b3a985c4fe07f650.tar.bz2 |
[svn-r21557] Port r21556 to 1.8 branch
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/H5Omessage.c')
-rw-r--r-- | src/H5Omessage.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/H5Omessage.c b/src/H5Omessage.c index c151e5b..e2d3ac4 100644 --- a/src/H5Omessage.c +++ b/src/H5Omessage.c @@ -419,7 +419,7 @@ H5O_msg_write_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *ty * XXX: This doesn't handle freeing extra space in object header from * a message shrinking. */ - if((status = H5SM_try_share(f, dxpl_id, ((mesg_flags & H5O_MSG_FLAG_SHARED) ? NULL : oh), idx_msg->type->id, mesg, &mesg_flags)) < 0) + if((status = H5SM_try_share(f, dxpl_id, ((mesg_flags & H5O_MSG_FLAG_SHARED) ? NULL : oh), FALSE, idx_msg->type->id, mesg, &mesg_flags)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADMESG, FAIL, "error while trying to share message") if(status == FALSE && (mesg_flags & H5O_MSG_FLAG_SHARED)) HGOTO_ERROR(H5E_OHDR, H5E_BADMESG, FAIL, "message changed sharing status") @@ -1546,6 +1546,10 @@ H5O_msg_can_share(unsigned type_id, const void *mesg) ret_value = (type->share_flags & H5O_SHARE_IS_SHARABLE) ? TRUE : FALSE; } /* end else */ + /* If the message is shareable, both copy_file and post_copy_file must be + * defined */ + HDassert((type->post_copy_file && type->copy_file) || ret_value == FALSE); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_msg_can_share() */ @@ -1928,7 +1932,7 @@ H5O_msg_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, } /* end if */ else { /* Attempt to share message */ - if(H5SM_try_share(f, dxpl_id, oh, type->id, native, mesg_flags) < 0) + if(H5SM_try_share(f, dxpl_id, oh, FALSE, type->id, native, mesg_flags) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "error determining if message should be shared") } /* end else */ |