generic: test MADV_POPULATE_READ with IO errors
[xfstests-dev.git] / tests / xfs / 354
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2017 Oracle, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 354
6 #
7 # Populate a XFS filesystem and fuzz every AGFL field.
8 # Use xfs_repair to fix the corruption.
9 #
10 . ./common/preamble
11 _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair
12
13 _register_cleanup "_cleanup" BUS
14
15 # Import common functions.
16 . ./common/filter
17 . ./common/populate
18 . ./common/fuzzy
19
20 # real QA test starts here
21 _supported_fs xfs
22 _require_scratch_xfs_fuzz_fields
23
24 echo "Format and populate"
25 _scratch_populate_cached nofill > $seqres.full 2>&1
26
27 echo "Fuzz AGFL"
28 _scratch_xfs_fuzz_metadata '' 'offline' 'agfl 0' >> $seqres.full
29 echo "Done fuzzing AGFL"
30
31 echo "Fuzz AGFL flfirst"
32 flfirst=$(_scratch_xfs_db -c 'agf 0' -c 'p flfirst' | sed -e 's/flfirst = //g')
33 SCRATCH_XFS_LIST_METADATA_FIELDS="bno[${flfirst}]" _scratch_xfs_fuzz_metadata '' 'offline' 'agfl 0' >> $seqres.full
34 echo "Done fuzzing AGFL flfirst"
35
36 # success, all done
37 status=0
38 exit