summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVailin Choi <vchoi@hdfgroup.org>2016-04-01 22:39:46 (GMT)
committerVailin Choi <vchoi@hdfgroup.org>2016-04-01 22:39:46 (GMT)
commit653870dd035c76e2cf592cfcb768e95b72936c9d (patch)
treedd866e859dfccd4d5f77e0eb00ffa5437daefea3 /src
parentb60cfd39706a60703e549a022aebac186fcfc2c2 (diff)
downloadhdf5-653870dd035c76e2cf592cfcb768e95b72936c9d.zip
hdf5-653870dd035c76e2cf592cfcb768e95b72936c9d.tar.gz
hdf5-653870dd035c76e2cf592cfcb768e95b72936c9d.tar.bz2
[svn-r29606] Fix for shared file pointer HDFFV-9469. This is the same fix for revise_chunks (#28908).
Tested on jam, platypus, emu, kite, moohan, ostrich, osx1010test, quail.
Diffstat (limited to 'src')
-rw-r--r--src/H5Dio.c6
-rw-r--r--src/H5T.c28
2 files changed, 34 insertions, 0 deletions
diff --git a/src/H5Dio.c b/src/H5Dio.c
index 5a931cf..58031e8 100644
--- a/src/H5Dio.c
+++ b/src/H5Dio.c
@@ -420,6 +420,9 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space,
if(H5D__get_dxpl_cache(dxpl_id, &dxpl_cache) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache")
+ /* Patch the top level file pointer for dt->shared->u.vlen.f if needed */
+ H5T_patch_vlen_file(dataset->shared->type, dataset->oloc.file);
+
/* Set up datatype info for operation */
if(H5D__typeinfo_init(dataset, dxpl_cache, dxpl_id, mem_type_id, FALSE, &type_info) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set up type info")
@@ -640,6 +643,9 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space,
if(H5D__get_dxpl_cache(dxpl_id, &dxpl_cache) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache")
+ /* Patch the top level file pointer for dt->shared->u.vlen.f if needed */
+ H5T_patch_vlen_file(dataset->shared->type, dataset->oloc.file);
+
/* Set up datatype info for operation */
if(H5D__typeinfo_init(dataset, dxpl_cache, dxpl_id, mem_type_id, TRUE, &type_info) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set up type info")
diff --git a/src/H5T.c b/src/H5T.c
index 29d8f40..9673ee9 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -5452,3 +5452,31 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T_patch_file() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5T_patch_vlen_file
+ *
+ * Purpose: Patch the top-level file pointer contained in (dt->shared->u.vlen.f)
+ * to point to f. This is possible because
+ * the top-level file pointer can be closed out from under
+ * dt while dt is contained in the shared file's cache.
+ *
+ * Return: SUCCEED
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5T_patch_vlen_file(H5T_t *dt, H5F_t *f)
+{
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+ /* Sanity check */
+ HDassert(dt);
+ HDassert(dt->shared);
+ HDassert(f);
+
+ if((dt->shared->type == H5T_VLEN) && dt->shared->u.vlen.f != f)
+ dt->shared->u.vlen.f = f;
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5T_patch_vlen_file() */