summaryrefslogtreecommitdiffstats
path: root/src/H5Oattribute.c
diff options
context:
space:
mode:
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 */