summaryrefslogtreecommitdiffstats
path: root/src/H5Olayout.c
diff options
context:
space:
mode:
authorVailin Choi <vchoi@hdfgroup.org>2009-04-16 15:21:01 (GMT)
committerVailin Choi <vchoi@hdfgroup.org>2009-04-16 15:21:01 (GMT)
commit35bbc743d4cf77d6aa8af2acf5578db02e5129ca (patch)
tree7da01b2a6b5eee7c1cef255d64702071dea01572 /src/H5Olayout.c
parent52fed52f9c6078729586186594e6e6955becb984 (diff)
downloadhdf5-35bbc743d4cf77d6aa8af2acf5578db02e5129ca.zip
hdf5-35bbc743d4cf77d6aa8af2acf5578db02e5129ca.tar.gz
hdf5-35bbc743d4cf77d6aa8af2acf5578db02e5129ca.tar.bz2
[svn-r16764] To fix a bug in extensible arrays as chunk index:
When the dataset is closed in H5D_close(), the pointer to the extensible array struct in the layout message is copied via H5D_flush_real() before H5D_chunk_dest(). This causes an abort from "Assertion `ea->hdr' failed" later when the dataset is re-opened and read. The bug was fixed by adding a flag to the reset function for indexed storage to set/not set the address of the indexed array. H5O_layout_copy() calls H5D_chunk_idx_reset() to reset only the pointer of the array struct for the chunked index storage.
Diffstat (limited to 'src/H5Olayout.c')
-rw-r--r--src/H5Olayout.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/H5Olayout.c b/src/H5Olayout.c
index b92a8bb..c79f328 100644
--- a/src/H5Olayout.c
+++ b/src/H5Olayout.c
@@ -447,6 +447,10 @@ done:
* Programmer: Robb Matzke
* Wednesday, October 8, 1997
*
+ * Modifications:
+ * Vailin Choi; April 2009
+ * Reset the pointer of the chunked storage index but not the address
+ *
*-------------------------------------------------------------------------
*/
static void *
@@ -474,8 +478,13 @@ H5O_layout_copy(const void *_mesg, void *_dest)
/* Copy over the raw data */
HDmemcpy(dest->u.compact.buf, mesg->u.compact.buf, dest->u.compact.size);
+
} /* end if */
+ /* Reset the pointer of the chunked storage index but not the address */
+ if(dest->type == H5D_CHUNKED && dest->u.chunk.ops)
+ H5D_chunk_idx_reset(dest, FALSE);
+
/* Set return value */
ret_value = dest;
@@ -654,6 +663,10 @@ done:
* Programmer: Peter Cao
* July 23, 2005
*
+ * Modifications:
+ * Vailin Choi; April 2009
+ * Reset address and pointer of the array struct for the chunked storage index
+ *
*-------------------------------------------------------------------------
*/
static void *
@@ -713,7 +726,7 @@ H5O_layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst,
case H5D_CHUNKED:
if(H5D_chunk_is_space_alloc(layout_src)) {
/* Layout is not created in the destination file, reset index address */
- if(H5D_chunk_idx_reset(layout_dst) < 0)
+ if(H5D_chunk_idx_reset(layout_dst, TRUE) < 0)
HGOTO_ERROR(H5E_IO, H5E_CANTINIT, NULL, "unable to reset chunked storage index in dest")
/* Create chunked layout */