diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2003-04-11 16:37:18 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2003-04-11 16:37:18 (GMT) |
commit | e804b4c75b06a0d28793a197d6511de2e781e0e5 (patch) | |
tree | 720021286d55c2dbd6d3ad32ce29e0db0d3f8a2e /src | |
parent | 705194a4ea98dbc5f0f4c8f78158a162c724512b (diff) | |
download | hdf5-e804b4c75b06a0d28793a197d6511de2e781e0e5.zip hdf5-e804b4c75b06a0d28793a197d6511de2e781e0e5.tar.gz hdf5-e804b4c75b06a0d28793a197d6511de2e781e0e5.tar.bz2 |
[svn-r6632] Purpose:
Bug fix
Description:
This fixes a bug in the low-level metadata caching code in the library
which could possibly lose metadata during file I/O when a lot of objects are
inserted into a group.
This also fixes a couple of (similar) fencepost bugs in the B-tree
deletion code.
Solution:
For the metadata bug - call the low-level driver's 'write' routine instead
of H5FD_write.
For the B-tree bug - include the correct number of keys.
Platforms tested:
FreeBSD 4.8 (sleipnir) w/C++
Linux 2.4 (burrwhite) w/FORTRAN
Solaris 2.7 (arabica) w/FORTRAN
IRIX64 6.5 (modi4) w/FORTRAN & parallel
(h5committest is still not working for me on burrwhite)
Misc. update:
Diffstat (limited to 'src')
-rw-r--r-- | src/H5B.c | 4 | ||||
-rw-r--r-- | src/H5FD.c | 3 |
2 files changed, 4 insertions, 3 deletions
@@ -1738,7 +1738,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type HDmemmove(bt->child, bt->child+1, bt->nchildren * sizeof(haddr_t)); - for (i=0; i<bt->nchildren; i++) { + for (i=0; i<=bt->nchildren; i++) { bt->key[i].dirty = bt->key[i+1].dirty; if (bt->key[i+1].nkey) { bt->key[i].nkey = bt->native + i*type->sizeof_nkey; @@ -1787,7 +1787,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type HDmemmove(bt->child+idx, bt->child+idx+1, (bt->nchildren-idx) * sizeof(haddr_t)); - for (i=idx; i<bt->nchildren; i++) { + for (i=idx; i<=bt->nchildren; i++) { bt->key[i].dirty = bt->key[i+1].dirty; if (bt->key[i+1].nkey) { bt->key[i].nkey = bt->native + i*type->sizeof_nkey; @@ -2154,7 +2154,8 @@ H5FD_free(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t si H5_ASSIGN_OVERFLOW(tail_size,(file->accum_loc+file->accum_size)-tail_addr,haddr_t,size_t); /* Write out the part of the accumulator after the block to free */ - if (H5FD_write(file, H5FD_MEM_DEFAULT, dxpl_id, tail_addr, tail_size, file->meta_accum+(tail_addr-file->accum_loc))<0) + /* (Use the driver's write call directly - to avoid looping back and writing to metadata accumulator) */ + if ((file->cls->write)(file, H5FD_MEM_DEFAULT, dxpl_id, tail_addr, tail_size, file->meta_accum+(tail_addr-file->accum_loc))<0) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "file write request failed"); } /* end if */ |