summaryrefslogtreecommitdiffstats
path: root/src/H5Fmount.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2005-07-16 16:33:15 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2005-07-16 16:33:15 (GMT)
commit5e98b5bb36c9e0b1078e56d9b734657fcfe7a03d (patch)
tree1bf4e62685089c126e5143617ccde2ff87e923e3 /src/H5Fmount.c
parent0daa76a15095d395a3901ca1b1b38dcbc60ebb23 (diff)
downloadhdf5-5e98b5bb36c9e0b1078e56d9b734657fcfe7a03d.zip
hdf5-5e98b5bb36c9e0b1078e56d9b734657fcfe7a03d.tar.gz
hdf5-5e98b5bb36c9e0b1078e56d9b734657fcfe7a03d.tar.bz2
[svn-r11077] Purpose:
Bug fix Description: Further progress on fixing file mounting to work properly. Platforms tested: FreeBSD 4.11 (sleipnir) Linux 2.4 Too minor to require h5committest
Diffstat (limited to 'src/H5Fmount.c')
-rw-r--r--src/H5Fmount.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/H5Fmount.c b/src/H5Fmount.c
index 73a450d..c67f40d 100644
--- a/src/H5Fmount.c
+++ b/src/H5Fmount.c
@@ -78,9 +78,14 @@ H5F_close_mounts(H5F_t *f)
/* Unmount all child files */
for (u = 0; u < f->mtab.nmounts; u++) {
+ /* Detach the child file from the parent file */
f->mtab.child[u].file->mtab.parent = NULL;
+
+ /* Close the internal group maintaining the mount point */
if(H5G_close(f->mtab.child[u].group) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "can't close child group")
+
+ /* Close the child file */
if(H5F_close(f->mtab.child[u].file) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't close child file")
} /* end if */
@@ -633,13 +638,13 @@ done:
static hbool_t
H5F_check_mounts_recurse(H5F_t *f)
{
- hbool_t ret_value; /* Return value */
+ hbool_t ret_value = FALSE; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_check_mounts_recurse)
/* Check if this file is closing and if the only objects left open are
* the mount points */
- if(f->closing && f->nopen_objs == f->mtab.nmounts) {
+ if((f->closing || (f->nrefs == 1 && f->mtab.parent)) && f->nopen_objs == f->mtab.nmounts) {
unsigned u;
/* Iterate over files mounted in this file and check if all can be closed */
@@ -648,9 +653,10 @@ H5F_check_mounts_recurse(H5F_t *f)
|| !H5F_check_mounts_recurse(f->mtab.child[u].file))
HGOTO_DONE(FALSE)
} /* end for */
- } /* end if */
- ret_value = TRUE;
+ /* Set return value */
+ ret_value = TRUE;
+ } /* end if */
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -703,7 +709,8 @@ H5F_check_mounts(H5F_t *f)
if(H5F_close_mounts(top) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't unmount child file")
- H5I_dec_ref(top->closing);
+ if(H5I_dec_ref(top->closing) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTDEC, FAIL, "can't decrement file closing ID")
} /* end if */
} /* end if */