summaryrefslogtreecommitdiffstats
path: root/src/H5Fint.c
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2015-06-19 22:16:45 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2015-06-19 22:16:45 (GMT)
commit6063aa87e16561162a7bd192a50c851c200b3150 (patch)
tree9fd17bb8ed393b4f3e237f2b94949f2050efd884 /src/H5Fint.c
parent3b1acf484e582941fa95173f6feca275800778ac (diff)
parent48e1bbb0f87c6712189f82a7c5d8835a87d21ee2 (diff)
downloadhdf5-6063aa87e16561162a7bd192a50c851c200b3150.zip
hdf5-6063aa87e16561162a7bd192a50c851c200b3150.tar.gz
hdf5-6063aa87e16561162a7bd192a50c851c200b3150.tar.bz2
[svn-r27256] Merge revisions 27102 through 27255 from trunk to vds branch.
Tested: ummon
Diffstat (limited to 'src/H5Fint.c')
-rw-r--r--src/H5Fint.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/H5Fint.c b/src/H5Fint.c
index ae6551e..c9e1ac0 100644
--- a/src/H5Fint.c
+++ b/src/H5Fint.c
@@ -803,6 +803,14 @@ H5F_dest(H5F_t *f, hid_t dxpl_id, hbool_t flush)
HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache")
} /* end if */
+ /* if it exists, unpin the driver information block cache entry,
+ * since we're about to destroy the cache
+ */
+ if(f->shared->drvinfo)
+ if(H5AC_unpin_entry(f->shared->drvinfo) < 0)
+ /* Push error, but keep going*/
+ HDONE_ERROR(H5E_FSPACE, H5E_CANTUNPIN, FAIL, "unable to unpin drvinfo")
+
/* Unpin the superblock, since we're about to destroy the cache */
if(H5AC_unpin_entry(f->shared->sblock) < 0)
/* Push error, but keep going*/
@@ -857,14 +865,6 @@ H5F_dest(H5F_t *f, hid_t dxpl_id, hbool_t flush)
/* Push error, but keep going*/
HDONE_ERROR(H5E_FILE, H5E_CANTDEC, FAIL, "can't close property list")
- /* Only truncate the file on an orderly close, with write-access */
- if(f->closing && (H5F_ACC_RDWR & H5F_INTENT(f))) {
- /* Truncate the file to the current allocated size */
- if(H5FD_truncate(f->shared->lf, dxpl_id, (unsigned)TRUE) < 0)
- /* Push error, but keep going*/
- HDONE_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "low level truncate failed")
- } /* end if */
-
/* Close the file */
if(H5FD_close(f->shared->lf) < 0)
/* Push error, but keep going*/
@@ -1182,6 +1182,15 @@ H5F_flush(H5F_t *f, hid_t dxpl_id, hbool_t closing)
/* Push error, but keep going*/
HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush metadata cache")
+ /* Truncate the file to the current allocated size */
+ if(H5FD_truncate(f->shared->lf, dxpl_id, closing) < 0)
+ HDONE_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "low level truncate failed")
+
+ /* Flush the entire metadata cache again since the EOA could have changed in the truncate call. */
+ if(H5AC_flush(f, dxpl_id) < 0)
+ /* Push error, but keep going*/
+ HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush metadata cache")
+
/* Set up I/O info for operation */
fio_info.f = f;
if(NULL == (fio_info.dxpl = (H5P_genplist_t *)H5I_object(dxpl_id)))