The fiemap filters used in the punch hole tests parse the extent
flags in the fiemap to determine the extent type. They are
currently parsing them as decimal values, but they should be parsing
hex values.
Signed-off-by: Allison Henderson <achender@linux.vnet.ibm.com>
Signed-off-by: Alex Elder <aelder@sgi.com>
This patch adds a new test 255 that tests fallocate punch hole,
but is for use by generic filesystems. It is similar to 252,
but uses a weaker fiemap filter that only displays the location
of the hole, and not the extent types.
Signed-off-by: Allison Henderson <achender@linux.vnet.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
This patch modifies test 252 to run for only xfs, and also
adds an md5 checksum to each of the punch hole tests
Signed-off-by: Allison Henderson <achender@linux.vnet.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
This patch adds additional punch hole tests to 252
that were used to test ext4 punch hole. The _test_generic_punch
routine has been modified to accept two new flags:
-k To keep the test file between tests.
This will test the handling of existing holes
-d To not sync the file between tests.
This will test the handling of delayed extents
Four new corner cases have also been added to the routine:
14. data -> hole @ EOF
15. data -> hole @ 0
16. data -> cache cold ->hole
17. data -> hole in single block file
Signed-off-by: Allison Henderson <achender@us.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
The specific set of extent sizes allocated to a file is not always
deterministic. In particular, sometimes a range of unwritten blocks
is covered by a single extent, while in other cases it might be
represented by multiple consecutive unwritten extents. This can
result in spurious errors being reported in tests that check file
extent maps.
Add a filter that finds adjacent extents in what gets produced for
fiemap and bmap output and coalesces them as if all consective
extents of the same time were really just one extent. (Note that
as implemented here this applies to all extent types, not just
unwritten extents.)
Update the golden output for test 242 to reflect the change.
Signed-off-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Move the major test meat of 242 into common.punch, and reuse it for
a new testcase the exercises the new fallocate implementation
Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
While most tests use /bin/sh, they are dependent on /bin/sh being a
bash shell. Convert all the tests to execute via /bin/bash as it is
much, much simpler than trying to debug and remove all the bashisms
throughout the test code.
Signed-off-by: Dave Chinner <david@fromorbit.com>
Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
_test_punch the main test function follows the procedure:
- mkfs & mount scratch
- optionally set files extent size hint
- truncate and optionally resvsp
- write or punch to file in specified order at given offsets & lengths
- display the file state (bmap) after each operation
All sizes, offsets and lengths are specified in FS blocks.
Problems may arise on non bash shells due to array usage.
Merge of master-melb:xfs-cmds:29434a by kenmcd.