summaryrefslogtreecommitdiffstats
path: root/src/H5Distore.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-08-17 07:30:18 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-08-17 07:30:18 (GMT)
commit2d3c6215f26b94e6fa0cb46178ea5c60fa075d66 (patch)
tree4fc137e84fd1a4ca4925de9b35f61bc40207767b /src/H5Distore.c
parent3646a3f83dc32b46c18fe2bfde9a2acdc70680f4 (diff)
downloadhdf5-2d3c6215f26b94e6fa0cb46178ea5c60fa075d66.zip
hdf5-2d3c6215f26b94e6fa0cb46178ea5c60fa075d66.tar.gz
hdf5-2d3c6215f26b94e6fa0cb46178ea5c60fa075d66.tar.bz2
[svn-r9101] Purpose:
Bug fix Description: 1 - Dataset contiguous storage cache information had a bug where it was possible to try to access invalid cache information if the cache wasn't filled the first time it attempted to loop through the list of offset/length vectors. 2 - Additionally, the contiguous storage cache information was being used in certain circumstances from the chunked dataset I/O code path, which was generally fatal since the chunk storage and contiguous storage information were stored together in a union. Solution: 1 - Avoid special case of first trip through loop over offset/length I/O vectors and always check for the contiguous storage sieve buffer buffer being NULL. 2 - Change the union containing the chunk and contiguous storage cache information into a struct, allowing both to be used at the same time. Platforms tested: FreeBSD 4.10 (sleipnir) h5committested
Diffstat (limited to 'src/H5Distore.c')
-rw-r--r--src/H5Distore.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/H5Distore.c b/src/H5Distore.c
index 756f5a1..cbd7a0f 100644
--- a/src/H5Distore.c
+++ b/src/H5Distore.c
@@ -935,7 +935,6 @@ H5D_istore_init (H5F_t *f, H5D_t *dset)
FUNC_ENTER_NOAPI(H5D_istore_init, FAIL);
- HDmemset (rdcc, 0, sizeof(H5D_rdcc_t));
if (H5F_RDCC_NBYTES(f)>0 && H5F_RDCC_NELMTS(f)>0) {
rdcc->nbytes=H5F_RDCC_NBYTES(f);
rdcc->nslots = H5F_RDCC_NELMTS(f);
@@ -1609,7 +1608,7 @@ else
}
assert (found || chunk_size>0);
- if (!found && rdcc->nslots>0 && chunk_size<=dset->cache.chunk.nbytes &&
+ if (!found && rdcc->nslots>0 && chunk_size<=rdcc->nbytes &&
(!ent || !ent->locked)) {
/*
* Add the chunk to the cache only if the slot is not already locked.
@@ -1848,13 +1847,13 @@ H5D_istore_readvv(H5F_t *f, const struct H5D_dxpl_cache_t *dxpl_cache, hid_t dxp
/* Get the address of this chunk on disk */
#ifdef QAK
-HDfprintf(stderr,"%s: chunk_coords={",FUNC);
+HDfprintf(stderr,"%s: store->chunk.offset={",FUNC);
for(u=0; u<dset->layout.u.chunk.ndims; u++)
- HDfprintf(stderr,"%Hd%s",chunk_coords[u],(u<(dset->layout.u.chunk.ndims-1) ? ", " : "}\n"));
+ HDfprintf(stderr,"%Hd%s",store->chunk.offset[u],(u<(dset->layout.u.chunk.ndims-1) ? ", " : "}\n"));
#endif /* QAK */
chunk_addr=H5D_istore_get_addr(f, dxpl_id, &(dset->layout), store->chunk.offset, &udata);
#ifdef QAK
-HDfprintf(stderr,"%s: chunk_addr=%a, chunk_size=%Hu\n",FUNC,chunk_addr,dset->layout.u.chunk.size);
+HDfprintf(stderr,"%s: chunk_addr=%a, chunk_size=%Zu\n",FUNC,chunk_addr,dset->layout.u.chunk.size);
HDfprintf(stderr,"%s: chunk_len_arr[%Zu]=%Zu\n",FUNC,*chunk_curr_seq,chunk_len_arr[*chunk_curr_seq]);
HDfprintf(stderr,"%s: chunk_offset_arr[%Zu]=%Hu\n",FUNC,*chunk_curr_seq,chunk_offset_arr[*chunk_curr_seq]);
HDfprintf(stderr,"%s: mem_len_arr[%Zu]=%Zu\n",FUNC,*mem_curr_seq,mem_len_arr[*mem_curr_seq]);
@@ -1963,13 +1962,13 @@ H5D_istore_writevv(H5F_t *f, const struct H5D_dxpl_cache_t *dxpl_cache,
/* Get the address of this chunk on disk */
#ifdef QAK
-HDfprintf(stderr,"%s: chunk_coords={",FUNC);
+HDfprintf(stderr,"%s: store->chunk.offset={",FUNC);
for(u=0; u<dset->layout.u.chunk.ndims; u++)
- HDfprintf(stderr,"%Hd%s",chunk_coords[u],(u<(dset->layout.u.chunk.ndims-1) ? ", " : "}\n"));
+ HDfprintf(stderr,"%Hd%s",store->chunk.offset[u],(u<(dset->layout.u.chunk.ndims-1) ? ", " : "}\n"));
#endif /* QAK */
chunk_addr=H5D_istore_get_addr(f, dxpl_id, &(dset->layout), store->chunk.offset, &udata);
#ifdef QAK
-HDfprintf(stderr,"%s: chunk_addr=%a, chunk_size=%Hu\n",FUNC,chunk_addr,dset->layout.u.chunk.size);
+HDfprintf(stderr,"%s: chunk_addr=%a, chunk_size=%Zu\n",FUNC,chunk_addr,dset->layout.u.chunk.size);
HDfprintf(stderr,"%s: chunk_len_arr[%Zu]=%Zu\n",FUNC,*chunk_curr_seq,chunk_len_arr[*chunk_curr_seq]);
HDfprintf(stderr,"%s: chunk_offset_arr[%Zu]=%Hu\n",FUNC,*chunk_curr_seq,chunk_offset_arr[*chunk_curr_seq]);
HDfprintf(stderr,"%s: mem_len_arr[%Zu]=%Zu\n",FUNC,*mem_curr_seq,mem_len_arr[*mem_curr_seq]);