summaryrefslogtreecommitdiffstats
path: root/src/H5Oattribute.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2010-07-29 18:17:32 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2010-07-29 18:17:32 (GMT)
commit178b80b679b874d99287b28898e242533721ea67 (patch)
treebf2d164035cb9f0d974390b0028f103ea6c0bbb7 /src/H5Oattribute.c
parent0357b5ad527e074238324d0985e38f3ba94ed9f5 (diff)
downloadhdf5-178b80b679b874d99287b28898e242533721ea67.zip
hdf5-178b80b679b874d99287b28898e242533721ea67.tar.gz
hdf5-178b80b679b874d99287b28898e242533721ea67.tar.bz2
[svn-r19150] Correction from the previous checkin for H5Oattribute.c. Because the attribute structure i
is shared now. The only situation that requires copying the data is when the metadata cache evicts and reloads this attribute. The attribute structure will be different in that situation. Tested on jam.
Diffstat (limited to 'src/H5Oattribute.c')
-rw-r--r--src/H5Oattribute.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/H5Oattribute.c b/src/H5Oattribute.c
index a1dcdc5..dcb129d 100644
--- a/src/H5Oattribute.c
+++ b/src/H5Oattribute.c
@@ -849,9 +849,14 @@ H5O_attr_write_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/,
if(NULL == (chk_proxy = H5O_chunk_protect(udata->f, udata->dxpl_id, oh, mesg->chunkno)))
HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, H5_ITER_ERROR, "unable to load object header chunk")
- /* No need to allocate data buffer or copy the data because the structure is shared
- * now. Only do an assertion check, instead. SLU - 2010/7/28 */
- HDassert(((H5A_t *)mesg->native)->shared == udata->attr->shared);
+ /* Because the attribute structure is shared now. The only situation that requires
+ * copying the data is when the metadata cache evicts and reloads this attribute.
+ * The attribute structure will be different in that situation. SLU-2010/7/29 */
+ if(((H5A_t *)mesg->native)->shared != udata->attr->shared)
+ /* (Needs to occur before updating the shared message, or the hash
+ * value on the old & new messages will be the same) */
+ HDmemcpy(((H5A_t *)mesg->native)->shared->data, udata->attr->shared->data,
+ udata->attr->shared->data_size);
/* Mark the message as modified */
mesg->dirty = TRUE;