diff options
author | Mike McGreevy <mamcgree@hdfgroup.org> | 2010-10-08 13:59:10 (GMT) |
---|---|---|
committer | Mike McGreevy <mamcgree@hdfgroup.org> | 2010-10-08 13:59:10 (GMT) |
commit | 3bf8b6a38a1594f11f316017416e0bb3040636a6 (patch) | |
tree | 613a551e388173cbf7e7a99c0c1c1783b785609b /src/H5Faccum.c | |
parent | b1edd6811eeef806f72bbe135bcc906d4d5fa7c6 (diff) | |
download | hdf5-3bf8b6a38a1594f11f316017416e0bb3040636a6.zip hdf5-3bf8b6a38a1594f11f316017416e0bb3040636a6.tar.gz hdf5-3bf8b6a38a1594f11f316017416e0bb3040636a6.tar.bz2 |
[svn-r19545] Purpose:
Patch for metadata accumulator bug
Description:
Linew failed one of the randomly seeded fheap tests
due to a corner case bug in the metadata accumulator code.
This patch fixes the corner case.
Tested:
used same random seed in fheap tests to reproduce and
verify on linew; plus full make check on jam.
unit tests for accumulator code coming soon.
Diffstat (limited to 'src/H5Faccum.c')
-rw-r--r-- | src/H5Faccum.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/H5Faccum.c b/src/H5Faccum.c index 2fc53ea..7e665ee 100644 --- a/src/H5Faccum.c +++ b/src/H5Faccum.c @@ -312,12 +312,6 @@ H5F_accum_adjust(H5F_meta_accum_t *accum, H5FD_t *lf, hid_t dxpl_id, accum->dirty = FALSE; } /* end if */ - /* Move remnant of accumulator down */ - HDmemmove(accum->buf, (accum->buf + shrink_size), remnant_size); - - /* Adjust accumulator's location */ - accum->loc += shrink_size; - /* Adjust dirty region tracking info */ accum->dirty_off -= shrink_size; } /* end else */ @@ -325,6 +319,15 @@ H5F_accum_adjust(H5F_meta_accum_t *accum, H5FD_t *lf, hid_t dxpl_id, /* Trim the accumulator's use of its buffer */ accum->size = remnant_size; + + /* When appending, need to adjust location of accumulator */ + if (H5F_ACCUM_APPEND == adjust) { + /* Move remnant of accumulator down */ + HDmemmove(accum->buf, (accum->buf + shrink_size), remnant_size); + + /* Adjust accumulator's location */ + accum->loc += shrink_size; + } /* end if */ } /* end if */ /* Check for accumulator needing to be reallocated */ |