diff options
author | Neil Fortner <nfortne2@hdfgroup.org> | 2012-07-25 21:50:22 (GMT) |
---|---|---|
committer | Neil Fortner <nfortne2@hdfgroup.org> | 2012-07-25 21:50:22 (GMT) |
commit | c04144fb39b6d7a489c37e89ac8a0240991026a6 (patch) | |
tree | 8f2d927263672bd7b524673a8943d1a982a8a470 /src/H5Otest.c | |
parent | b5ef63b550d4d1149aebb0c46aebc7df672427aa (diff) | |
download | hdf5-c04144fb39b6d7a489c37e89ac8a0240991026a6.zip hdf5-c04144fb39b6d7a489c37e89ac8a0240991026a6.tar.gz hdf5-c04144fb39b6d7a489c37e89ac8a0240991026a6.tar.bz2 |
[svn-r22601] Purpose: Fix HDFFV-5853
Description:
When jumping out from between H5_BEGIN_TAG and H5_END_TAG macros using
HGOTO_ERROR or HGOTO_DONE, the previous metadata tag is not reset on the dxpl.
This could cause problems when, for example, calling H5Ocopy within an
H5Literate callback.
Added new HGOTO_ERROR_TAG and HGOTO_DONE_TAG macros which must be used in place
of the above between H5_BEGIN_TAG and H5_END_TAG.
Tested:
jam, koala, ostrich (h5committest), durandal
Diffstat (limited to 'src/H5Otest.c')
-rw-r--r-- | src/H5Otest.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/H5Otest.c b/src/H5Otest.c index ca1b426..5802904 100644 --- a/src/H5Otest.c +++ b/src/H5Otest.c @@ -193,13 +193,13 @@ H5O_is_attr_empty_test(hid_t oid) if(H5F_addr_defined(ainfo.fheap_addr)) { /* Check for any messages in object header */ HDassert(nattrs == 0); - + /* Set metadata tag in dxpl_id */ H5_BEGIN_TAG(H5AC_ind_dxpl_id, loc->addr, FAIL); /* Open the name index v2 B-tree */ if(NULL == (bt2_name = H5B2_open(loc->file, H5AC_ind_dxpl_id, ainfo.name_bt2_addr, NULL))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") + HGOTO_ERROR_TAG(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Reset metadata tag in dxpl_id */ H5_END_TAG(FAIL); @@ -292,7 +292,7 @@ H5O_num_attrs_test(hid_t oid, hsize_t *nattrs) /* Open the name index v2 B-tree */ if(NULL == (bt2_name = H5B2_open(loc->file, H5AC_ind_dxpl_id, ainfo.name_bt2_addr, NULL))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") + HGOTO_ERROR_TAG(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Reset metadata tag in dxpl_id */ H5_END_TAG(FAIL); @@ -362,39 +362,39 @@ H5O_attr_dense_info_test(hid_t oid, hsize_t *name_count, hsize_t *corder_count) /* Get the object header */ if(NULL == (oh = H5O_protect(loc, H5AC_ind_dxpl_id, H5AC_READ))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") + HGOTO_ERROR_TAG(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; if(oh->version > H5O_VERSION_1) { /* Check for (& retrieve if available) attribute info */ if(H5A_get_ainfo(loc->file, H5AC_ind_dxpl_id, oh, &ainfo) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") + HGOTO_ERROR_TAG(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") } /* end if */ /* Check for 'dense' attribute storage file addresses being defined */ if(!H5F_addr_defined(ainfo.fheap_addr)) - HGOTO_DONE(FAIL) + HGOTO_DONE_TAG(FAIL, FAIL) if(!H5F_addr_defined(ainfo.name_bt2_addr)) - HGOTO_DONE(FAIL) + HGOTO_DONE_TAG(FAIL, FAIL) /* Open the name index v2 B-tree */ if(NULL == (bt2_name = H5B2_open(loc->file, H5AC_ind_dxpl_id, ainfo.name_bt2_addr, NULL))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") + HGOTO_ERROR_TAG(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Retrieve # of records in name index */ if(H5B2_get_nrec(bt2_name, name_count) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTCOUNT, FAIL, "unable to retrieve # of records from name index") + HGOTO_ERROR_TAG(H5E_OHDR, H5E_CANTCOUNT, FAIL, "unable to retrieve # of records from name index") /* Check if there is a creation order index */ if(H5F_addr_defined(ainfo.corder_bt2_addr)) { /* Open the creation order index v2 B-tree */ if(NULL == (bt2_corder = H5B2_open(loc->file, H5AC_ind_dxpl_id, ainfo.corder_bt2_addr, NULL))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for creation order index") + HGOTO_ERROR_TAG(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for creation order index") /* Retrieve # of records in creation order index */ if(H5B2_get_nrec(bt2_corder, corder_count) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTCOUNT, FAIL, "unable to retrieve # of records from creation order index") + HGOTO_ERROR_TAG(H5E_OHDR, H5E_CANTCOUNT, FAIL, "unable to retrieve # of records from creation order index") } /* end if */ else *corder_count = 0; |