summaryrefslogtreecommitdiffstats
path: root/src/H5Distore.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-08-17 07:30:23 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-08-17 07:30:23 (GMT)
commit8d40aa83cfa3cc2a062d30ffbc2eb423a3485985 (patch)
treeab5bc91581a65695b4b9a37a4ae395bee70dad54 /src/H5Distore.c
parentf69b447fab64f5cc7cdd66b6fc50a9ccc07745d6 (diff)
downloadhdf5-8d40aa83cfa3cc2a062d30ffbc2eb423a3485985.zip
hdf5-8d40aa83cfa3cc2a062d30ffbc2eb423a3485985.tar.gz
hdf5-8d40aa83cfa3cc2a062d30ffbc2eb423a3485985.tar.bz2
[svn-r9102] 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 daa2582..cadda13 100644
--- a/src/H5Distore.c
+++ b/src/H5Distore.c
@@ -939,7 +939,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);
@@ -1613,7 +1612,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.
@@ -1852,13 +1851,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]);
@@ -1967,13 +1966,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]);