xfs: Check for extent overflow when trivally adding a new extent
[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 seq=`basename $0`
11 seqres=$RESULT_DIR/$seq
12 echo "QA output created by $seq"
13
14 here=`pwd`
15 tmp=/tmp/$$
16 status=1        # failure is the default!
17 trap "_cleanup; exit \$status" 0 1 2 3 7 15
18
19 _cleanup()
20 {
21         cd /
22         rm -rf $tmp.*
23 }
24
25 # get standard environment, filters and checks
26 . ./common/rc
27 . ./common/filter
28 . ./common/populate
29 . ./common/fuzzy
30
31 # real QA test starts here
32 _supported_fs xfs
33 _require_scratch_xfs_fuzz_fields
34
35 echo "Format and populate"
36 _scratch_populate_cached nofill > $seqres.full 2>&1
37
38 echo "Fuzz AGFL"
39 _scratch_xfs_fuzz_metadata '' 'offline' 'agfl 0' >> $seqres.full
40 echo "Done fuzzing AGFL"
41
42 echo "Fuzz AGFL flfirst"
43 flfirst=$(_scratch_xfs_db -c 'agf 0' -c 'p flfirst' | sed -e 's/flfirst = //g')
44 SCRATCH_XFS_LIST_METADATA_FIELDS="bno[${flfirst}]" _scratch_xfs_fuzz_metadata '' 'offline' 'agfl 0' >> $seqres.full
45 echo "Done fuzzing AGFL flfirst"
46
47 # success, all done
48 status=0
49 exit