summaryrefslogtreecommitdiffstats
path: root/src/H5D.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-10-13 16:17:52 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-10-13 16:17:52 (GMT)
commita294ddffe58114b77b16812c180c62dd453f1407 (patch)
tree2fe3d61e24b39d87cfa3b247582448ee0f318d28 /src/H5D.c
parenta911db88e480efe9f818c0b70fdb8bfade80d417 (diff)
downloadhdf5-a294ddffe58114b77b16812c180c62dd453f1407.zip
hdf5-a294ddffe58114b77b16812c180c62dd453f1407.tar.gz
hdf5-a294ddffe58114b77b16812c180c62dd453f1407.tar.bz2
[svn-r19588] Description:
Bring r19587 from trunk to 1.8 branch: Address issue with object headers being created getting evicted from the metadata cache cache before they are completely initialized. This is done by pinning the object header in the cache until it is completely initialized and attached to a group. Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, w/threadsafe, in production mode Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode
Diffstat (limited to 'src/H5D.c')
-rw-r--r--src/H5D.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/H5D.c b/src/H5D.c
index 9442e8a..e260486 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -256,6 +256,20 @@ H5Dcreate_anon(hid_t loc_id, hid_t type_id, hid_t space_id, hid_t dcpl_id,
HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register dataset")
done:
+ /* Release the dataset's object header, if it was created */
+ if(dset) {
+ H5O_loc_t *oloc; /* Object location for dataset */
+
+ /* Get the new dataset's object location */
+ if(NULL == (oloc = H5D_oloc(dset)))
+ HDONE_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get object location of dataset")
+
+ /* Decrement refcount on dataset's object header in memory */
+ if(H5O_dec_rc_by_loc(oloc, H5AC_dxpl_id) < 0)
+ HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "unable to decrement refcount on newly created object")
+ } /* end if */
+
+ /* Cleanup on failure */
if(ret_value < 0)
if(dset && H5D_close(dset) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset")