xfsqa: make hole tests independent of speculative allocation patterns
authorDave Chinner <dchinner@redhat.com>
Fri, 7 Jan 2011 12:59:15 +0000 (23:59 +1100)
committerDave Chinner <david@fromorbit.com>
Fri, 7 Jan 2011 12:59:15 +0000 (23:59 +1100)
commit815637a2da137a36c710f9b7e446c13f12bfd2b6
tree5ec9b2a34aa473c8af4823178967a23b74f637f8
parent03292c4f37523f7fcda8f377d2b961e60b3cf145
xfsqa: make hole tests independent of speculative allocation patterns

Many of the "count-the-holes" tests (008, 012, etc) do writes that extend the
file and hence allocation patterns are dependent on speculative allocation
beyond EOF behaviour. Hence if we change that behaviour, these tests all fail
because there is a different pattern of holes.

Make the tests independent of EOF preallocation behaviour by first truncating
the file to the size the test is defined to use. This prevents speculative
prealocation from occurring, and hence changes in such behaviour will not cause
the tests to fail.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
203
src/holes.c
src/randholes.c