diff options
author | Albert Cheng <acheng@hdfgroup.org> | 2014-05-01 00:47:57 (GMT) |
---|---|---|
committer | Albert Cheng <acheng@hdfgroup.org> | 2014-05-01 00:47:57 (GMT) |
commit | 1852861737b491f791d2bbe223efec20e333ba6f (patch) | |
tree | 1111376f3048f3e48035702a02c76f6c53ea780d /src | |
parent | 0ce16924cd5f9454d48cb5d0c5bdc7e23df40112 (diff) | |
download | hdf5-1852861737b491f791d2bbe223efec20e333ba6f.zip hdf5-1852861737b491f791d2bbe223efec20e333ba6f.tar.gz hdf5-1852861737b491f791d2bbe223efec20e333ba6f.tar.bz2 |
[svn-r25140] Commit Joel's fix to this branch.
Bug Fix: HDFFV-8247
Description:
Failure to write fill values to the user's buffer when reading unallocated
chunks from datasets that have a fill value set to H5D_FILL_VALUE_DEFAULT.
A consequence of this was the reporting of spurious data values in h5dump
and h5diff output.
Solution:
Added check for fill value of H5D_FILL_VALUE_DEFAULT whenever fill value
setting was checked to decide whether or not to fill. This effectively
treats H5D_FILL_VALUE_DEFAULT the same as H5D_FILL_VALUE_USER rather than
H5D_FILL_VALUE_UNDEFINED.
Tested:
h5committest (platypus, ostrich, jam-pp, koala) ran successfully
(fillval test was modified to reveal and check for this error)
H5Dchunk.c:
fix in library code.
fillval.c:
Added test_partalloc to expose potential fill value issues.
Diffstat (limited to 'src')
-rw-r--r-- | src/H5Dchunk.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 7b8fc3a..43d140e 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -1731,8 +1731,9 @@ H5D__chunk_cacheable(const H5D_io_info_t *io_info, haddr_t caddr, hbool_t write_ /* If the fill value needs to be written then we will need * to use the cache to write the fill value */ if(fill->fill_time == H5D_FILL_TIME_ALLOC || - (fill->fill_time == H5D_FILL_TIME_IFSET - && fill_status == H5D_FILL_VALUE_USER_DEFINED)) + (fill->fill_time == H5D_FILL_TIME_IFSET && + (fill_status == H5D_FILL_VALUE_USER_DEFINED || + fill_status == H5D_FILL_VALUE_DEFAULT))) ret_value = TRUE; else ret_value = FALSE; @@ -1818,7 +1819,9 @@ H5D__chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, * but they aren't set, set the flag to skip missing chunks. */ if(fill->fill_time == H5D_FILL_TIME_NEVER || - (fill->fill_time == H5D_FILL_TIME_IFSET && fill_status != H5D_FILL_VALUE_USER_DEFINED)) + (fill->fill_time == H5D_FILL_TIME_IFSET && + fill_status != H5D_FILL_VALUE_USER_DEFINED && + fill_status != H5D_FILL_VALUE_DEFAULT)) skip_missing_chunks = TRUE; } @@ -2907,7 +2910,9 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't tell if fill value defined") if(fill->fill_time == H5D_FILL_TIME_ALLOC || - (fill->fill_time == H5D_FILL_TIME_IFSET && fill_status == H5D_FILL_VALUE_USER_DEFINED)) { + (fill->fill_time == H5D_FILL_TIME_IFSET && + (fill_status == H5D_FILL_VALUE_USER_DEFINED || + fill_status == H5D_FILL_VALUE_DEFAULT))) { /* * The chunk doesn't exist in the file. Replicate the fill * value throughout the chunk, if the fill value is defined. @@ -3332,7 +3337,9 @@ H5D__chunk_allocate(const H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, * set the "should fill" flag */ if((!full_overwrite && (fill->fill_time == H5D_FILL_TIME_ALLOC || - (fill->fill_time == H5D_FILL_TIME_IFSET && fill_status == H5D_FILL_VALUE_USER_DEFINED))) + (fill->fill_time == H5D_FILL_TIME_IFSET && + (fill_status == H5D_FILL_VALUE_USER_DEFINED || + fill_status == H5D_FILL_VALUE_DEFAULT)))) || pline->nused > 0) should_fill = TRUE; |