summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2014-04-14 16:17:52 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2014-04-14 16:17:52 (GMT)
commitb4c44f8eebad9056051a91d8afff7c6de704e752 (patch)
treed5d519e0c5d422d6f43cb083b60336f9f96876a8 /src
parent94ede7a8ced2e2bde23abe164c3128d288b04e52 (diff)
downloadhdf5-b4c44f8eebad9056051a91d8afff7c6de704e752.zip
hdf5-b4c44f8eebad9056051a91d8afff7c6de704e752.tar.gz
hdf5-b4c44f8eebad9056051a91d8afff7c6de704e752.tar.bz2
[svn-r25045] Fixed a few missing lines of code that were not merged when the
core VFD paging changes were brought over. Tested on: 32-bit LE linux (jam) 64-bit LE linux (koala) 64-bit BE linux (ostrich) All were tested with HDF5_DRIVER set to "core_paged".
Diffstat (limited to 'src')
-rw-r--r--src/H5FDcore.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/H5FDcore.c b/src/H5FDcore.c
index 2f51264..ee3a40e 100644
--- a/src/H5FDcore.c
+++ b/src/H5FDcore.c
@@ -1381,16 +1381,26 @@ H5FD_core_flush(H5FD_t *_file, hid_t UNUSED dxpl_id, unsigned UNUSED closing)
fprintf(stderr, "FLUSHING. DIRTY LIST:\n");
#endif
while(NULL != (item = (H5FD_core_region_t *)H5SL_remove_first(file->dirty_list))) {
- size = (size_t)((item->end - item->start) + 1);
+
+ /* The file may have been truncated, so check for that
+ * and skip or adjust as necessary.
+ */
+ if(item->start < file->eof) {
+ if(item->end >= file->eof)
+ item->end = file->eof - 1;
+
+
+ size = (size_t)((item->end - item->start) + 1);
#ifdef DER
fprintf(stderr, "(%llu, %llu : %lu)\n", item->start, item->end, size);
#endif
- if(H5FD_core_write_to_bstore(file, item->start, size) != SUCCEED)
- HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to write to backing store")
+ if(H5FD_core_write_to_bstore(file, item->start, size) != SUCCEED)
+ HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to write to backing store")
+ } /* end if */
+
item = H5FL_FREE(H5FD_core_region_t, item);
- }
+ } /* end while */
-
#ifdef DER
fprintf(stderr, "EOF: %llu\n", file->eof);
fprintf(stderr, "EOA: %llu\n", file->eoa);