summaryrefslogtreecommitdiffstats
path: root/src/H5Oattribute.c
diff options
context:
space:
mode:
authorVailin Choi <vchoi@jam.ad.hdfgroup.org>2018-07-20 16:21:50 (GMT)
committerVailin Choi <vchoi@jam.ad.hdfgroup.org>2018-07-20 16:21:50 (GMT)
commitad317226eacbf5b0a770e458290236ba91861fdc (patch)
treef27a351ab6c4bd7f879ecc99273ce8178a26a9f8 /src/H5Oattribute.c
parent32d5a3be1ca8a0a4ec8ad22373e00d65d8aad2f1 (diff)
downloadhdf5-ad317226eacbf5b0a770e458290236ba91861fdc.zip
hdf5-ad317226eacbf5b0a770e458290236ba91861fdc.tar.gz
hdf5-ad317226eacbf5b0a770e458290236ba91861fdc.tar.bz2
Fix for HDFFV-9277: update the ainfo message after removing an attribute.
Diffstat (limited to 'src/H5Oattribute.c')
-rw-r--r--src/H5Oattribute.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/H5Oattribute.c b/src/H5Oattribute.c
index e8a8433..640d1c7 100644
--- a/src/H5Oattribute.c
+++ b/src/H5Oattribute.c
@@ -1448,6 +1448,12 @@ H5O_attr_remove_update(const H5O_loc_t *loc, H5O_t *oh, H5O_ainfo_t *ainfo)
} /* end if */
} /* end if */
+ /* Update the message after removing the attribute */
+ /* This is particularly needed when removing the last attribute that is
+ accessed via fractal heap/v2 B-tree (HDFFV-9277) */
+ if(H5O__msg_write_real(loc->file, oh, H5O_MSG_AINFO, H5O_MSG_FLAG_DONTSHARE, 0, ainfo) < 0)
+ HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update attribute info message")
+
/* Check if we have deleted all the attributes and the attribute info
* message should be deleted itself.
*/
@@ -1455,9 +1461,6 @@ H5O_attr_remove_update(const H5O_loc_t *loc, H5O_t *oh, H5O_ainfo_t *ainfo)
if(H5O__msg_remove_real(loc->file, oh, H5O_MSG_AINFO, H5O_ALL, NULL, NULL, TRUE) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute info")
} /* end if */
- else
- if(H5O__msg_write_real(loc->file, oh, H5O_MSG_AINFO, H5O_MSG_FLAG_DONTSHARE, 0, ainfo) < 0)
- HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update attribute info message")
done:
/* Release resources */