generic: test MADV_POPULATE_READ with IO errors
[xfstests-dev.git] / tests / generic / 009
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright 2014 (C) Red Hat, Inc., Lukas Czerner <lczerner@redhat.com>
4 #
5 # FS QA Test No. 009
6 #
7 # Test fallocate FALLOC_FL_ZERO_RANGE
8 #
9 . ./common/preamble
10 _begin_fstest auto quick prealloc zero
11
12 # Import common functions.
13 . ./common/filter
14 . ./common/punch
15
16 # real QA test starts here
17 _require_xfs_io_command "fzero"
18 _require_xfs_io_command "fiemap"
19 _require_xfs_io_command "falloc"
20 _require_test
21
22 testfile=$TEST_DIR/009.$$
23
24 # Disable extent zeroing for ext4 as that change where holes are created
25 if [ "$FSTYP" = "ext4" ]; then
26         _ext4_disable_extent_zeroout
27 fi
28 if [ "$FSTYP" = "overlay" -a "$OVL_BASE_FSTYP" = "ext4" ]; then
29         _ext4_disable_extent_zeroout "$OVL_BASE_TEST_DEV"
30 fi
31
32 # Standard zero range tests
33 _test_generic_punch falloc fzero fzero fiemap _filter_fiemap $testfile
34
35 # Delayed allocation zero range tests
36 _test_generic_punch -d falloc fzero fzero fiemap _filter_fiemap $testfile
37
38 # Multi zero range tests
39 _test_generic_punch -k falloc fzero fzero fiemap _filter_fiemap $testfile
40
41 # Delayed allocation multi zero range tests
42 _test_generic_punch -d -k falloc fzero fzero fiemap _filter_fiemap $testfile
43
44 status=0 ; exit