diff options
author | Neil Fortner <nfortne2@hdfgroup.org> | 2011-05-02 04:12:47 (GMT) |
---|---|---|
committer | Neil Fortner <nfortne2@hdfgroup.org> | 2011-05-02 04:12:47 (GMT) |
commit | 1a93a07867719104184bce3e4a256a519aacf6ac (patch) | |
tree | 7dec8555dee6130af4e7992f69061c746181bd37 /src/H5Dint.c | |
parent | 4e204929ab54838d5e218c43776eff65bba78758 (diff) | |
download | hdf5-1a93a07867719104184bce3e4a256a519aacf6ac.zip hdf5-1a93a07867719104184bce3e4a256a519aacf6ac.tar.gz hdf5-1a93a07867719104184bce3e4a256a519aacf6ac.tar.bz2 |
[svn-r20691] Purpose: Fix problem exposed by external link cache
Description:
When closing an object that had two open id's, the library would previously fail
to account for the status of the "holding_file" field, potentially causing the
file's "nopen_objs" field to become inconsistent. This caused problems when
opening the same object twice through an external link using th external file
cache. Modified the library to properly account for the status of the
"holding_file" field when closing an object id, even when the underlying
"shared" object isn't closed.
Tested: jam, koala, heiwa (h5committest)
Diffstat (limited to 'src/H5Dint.c')
-rw-r--r-- | src/H5Dint.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/H5Dint.c b/src/H5Dint.c index e51f001..891b3a6 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -1457,9 +1457,14 @@ H5D_close(H5D_t *dataset) HGOTO_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "can't decrement count for object") /* Check reference count for this object in the top file */ - if(H5FO_top_count(dataset->oloc.file, dataset->oloc.addr) == 0) + if(H5FO_top_count(dataset->oloc.file, dataset->oloc.addr) == 0) { if(H5O_close(&(dataset->oloc)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to close") + } /* end if */ + else + /* Free object location (i.e. "unhold" the file if appropriate) */ + if(H5O_loc_free(&(dataset->oloc)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "problem attempting to free location") } /* end else */ /* Release the dataset's path info */ |