2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright 2014 (C) Red Hat, Inc., Lukas Czerner <lczerner@redhat.com>
7 # Test fallocate FALLOC_FL_ZERO_RANGE
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
15 status=1 # failure is the default!
22 trap "_cleanup ; exit \$status" 0 1 2 3 15
24 # get standard environment, filters and checks
29 # real QA test starts here
30 _require_xfs_io_command "fzero"
31 _require_xfs_io_command "fiemap"
32 _require_xfs_io_command "falloc"
35 testfile=$TEST_DIR/009.$$
37 # Disable extent zeroing for ext4 as that change where holes are created
38 if [ "$FSTYP" = "ext4" ]; then
39 _ext4_disable_extent_zeroout
41 if [ "$FSTYP" = "overlay" -a "$OVL_BASE_FSTYP" = "ext4" ]; then
42 _ext4_disable_extent_zeroout "$OVL_BASE_TEST_DEV"
45 # Standard zero range tests
46 _test_generic_punch falloc fzero fzero fiemap _filter_fiemap $testfile
48 # Delayed allocation zero range tests
49 _test_generic_punch -d falloc fzero fzero fiemap _filter_fiemap $testfile
51 # Multi zero range tests
52 _test_generic_punch -k falloc fzero fzero fiemap _filter_fiemap $testfile
54 # Delayed allocation multi zero range tests
55 _test_generic_punch -d -k falloc fzero fzero fiemap _filter_fiemap $testfile