2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2017 Oracle, Inc. All Rights Reserved.
7 # Populate a XFS filesystem and fuzz every leaf1-format dir block field.
8 # Use xfs_repair to fix the corruption.
11 seqres=$RESULT_DIR/$seq
12 echo "QA output created by $seq"
16 status=1 # failure is the default!
17 trap "_cleanup; exit \$status" 0 1 2 3 7 15
25 # get standard environment, filters and checks
31 # real QA test starts here
33 _require_scratch_xfs_fuzz_fields
35 echo "Format and populate"
36 _scratch_populate_cached nofill > $seqres.full 2>&1
38 echo "Find leaf1-format dir block"
40 inum=$(stat -c '%i' $SCRATCH_MNT/S_IFDIR.FMT_LEAF)
41 blk_sz=$(_get_block_size $SCRATCH_MNT)
44 leaf_offset=$(( (2 ** 35) / blk_sz))
45 echo "Fuzz leaf1-format dir block"
46 _scratch_xfs_fuzz_metadata '' 'offline' "inode ${inum}" "dblock ${leaf_offset}" >> $seqres.full
47 echo "Done fuzzing leaf1-format dir block"