mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-11-27 02:10:55 +08:00
Fix bounds check for the generation of cache image.
This commit is contained in:
parent
f122d6f27f
commit
8427eefafe
@ -1382,9 +1382,12 @@ H5C__prep_image_for_file_close(H5F_t *f, hid_t dxpl_id, hbool_t *image_generated
|
||||
* Note that under some error conditions, the superblock will be
|
||||
* undefined in this case as well -- if so, assume that the
|
||||
* superblock does not support superblock extension messages.
|
||||
* Also verify that the file's high_bound is at least release
|
||||
* 1.10.x, otherwise cancel the request for a cache image
|
||||
*/
|
||||
if((NULL == f->shared->sblock) ||
|
||||
(f->shared->sblock->super_vers < HDF5_SUPERBLOCK_VERSION_2)) {
|
||||
(f->shared->sblock->super_vers < HDF5_SUPERBLOCK_VERSION_2) ||
|
||||
(f->shared->high_bound < H5F_LIBVER_V110)) {
|
||||
H5C_cache_image_ctl_t default_image_ctl = H5C__DEFAULT_CACHE_IMAGE_CTL;
|
||||
|
||||
cache_ptr->image_ctl = default_image_ctl;
|
||||
|
@ -930,10 +930,6 @@ H5F_new(H5F_file_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t
|
||||
if(H5P_get(plist, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_NAME, &(f->shared->mdc_initCacheImageCfg)) < 0)
|
||||
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get initial metadata cache resize config")
|
||||
|
||||
/* Format version high bound does not allow the generation of metadata cache image */
|
||||
if(f->shared->mdc_initCacheImageCfg.generate_image && f->shared->high_bound < H5F_LIBVER_V110)
|
||||
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, NULL, "format version out of bound for cache image")
|
||||
|
||||
/* Get the VFD values to cache */
|
||||
f->shared->maxaddr = H5FD_get_maxaddr(lf);
|
||||
if(!H5F_addr_defined(f->shared->maxaddr))
|
||||
|
@ -856,10 +856,6 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial
|
||||
hbool_t rw = ((rw_flags & H5AC__READ_ONLY_FLAG) == 0);
|
||||
H5O_mdci_t mdci_msg;
|
||||
|
||||
/* Message exists but version high bound does not allow it */
|
||||
if(f->shared->high_bound < H5F_LIBVER_V110)
|
||||
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "format version out of bound for metadata cache image")
|
||||
|
||||
/* if the metadata cache image superblock extension message exists,
|
||||
* read its contents and pass the data on to the metadata cache.
|
||||
* Given this data, the cache will load and decode the metadata
|
||||
|
Loading…
Reference in New Issue
Block a user