summaryrefslogtreecommitdiffstats
path: root/src/H5O.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-07-14 19:08:34 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-07-14 19:08:34 (GMT)
commit769ee96c1fd7cdcc4de2f2b1f36e943ebf9fff8b (patch)
treed17a58cc98b8789145de837650aaba38dd7af262 /src/H5O.c
parentbc6ab7c0a6ff27d3d52707419385ccd0771ffa0c (diff)
downloadhdf5-769ee96c1fd7cdcc4de2f2b1f36e943ebf9fff8b.zip
hdf5-769ee96c1fd7cdcc4de2f2b1f36e943ebf9fff8b.tar.gz
hdf5-769ee96c1fd7cdcc4de2f2b1f36e943ebf9fff8b.tar.bz2
[svn-r8874] Purpose:
Bug fix Description: Correct problems with "resurrecting" a dataset in a file. (This occurs when a dataset which is open gets unlinked from the group hierarchy (making it "dead" and marked for deletion in the file) and then is re-linked to the group hierarchy). Note that the current solution applies only to datasets, further work will fix this for groups and named datatypes also. Also, fix the "debug" routines to be a little more helpful in certain situations. Additionally, fix a locking bug in the symbol table node splitting routine which could be [one of] the cause[s] of the file corruption in flexible parallel operation. Platforms tested: FreeBSD 4.10 (sleipnir) w/parallel h5committested
Diffstat (limited to 'src/H5O.c')
-rw-r--r--src/H5O.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/H5O.c b/src/H5O.c
index 2b1eb15..f1b4a23 100644
--- a/src/H5O.c
+++ b/src/H5O.c
@@ -1243,7 +1243,7 @@ H5O_link(const H5G_entry_t *ent, int adjust, hid_t dxpl_id)
/* Check if the object is still open by the user */
if(H5FO_opened(ent->file,ent->header)>=0) {
/* Flag the object to be deleted when it's closed */
- if(H5FO_mark(ent->file,ent->header)<0)
+ if(H5FO_mark(ent->file,ent->header,TRUE)<0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "can't mark object for deletion");
} /* end if */
else {
@@ -1256,6 +1256,16 @@ H5O_link(const H5G_entry_t *ent, int adjust, hid_t dxpl_id)
} /* end else */
} /* end if */
} else if (adjust>0) {
+ /* A new object, or one that will be deleted */
+ if(oh->nlink==0) {
+ /* Check if the object is current open, but marked for deletion */
+ if(H5FO_marked(ent->file,ent->header)>0) {
+ /* Remove "delete me" flag on the object */
+ if(H5FO_mark(ent->file,ent->header,FALSE)<0)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "can't mark object for deletion");
+ } /* end if */
+ } /* end if */
+
oh->nlink += adjust;
oh->cache_info.is_dirty = TRUE;
}
@@ -1974,8 +1984,6 @@ H5O_unprotect(H5G_entry_t *ent, H5O_t *oh, hid_t dxpl_id)
if (H5AC_unprotect(ent->file, dxpl_id, H5AC_OHDR, ent->header, oh, FALSE) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header");
- oh = NULL;
-
done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5O_unprotect() */
@@ -2624,7 +2632,7 @@ H5O_alloc_extend_chunk(H5O_t *oh, unsigned chunkno, size_t size)
/* try to extend a null message */
for (idx=0; idx<oh->nmesgs; idx++) {
if (oh->mesg[idx].chunkno==chunkno) {
- if ( H5O_NULL_ID == oh->mesg[idx].type->id &&
+ if (H5O_NULL_ID == oh->mesg[idx].type->id &&
(oh->mesg[idx].raw + oh->mesg[idx].raw_size ==
oh->chunk[chunkno].image + oh->chunk[chunkno].size)) {