xfs/007: fix regressions on V4 filesystems
[xfstests-dev.git] / tests / xfs / 474
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2018 Oracle, Inc.  All rights reserved.
4 #
5 # FS QA Test No. 474
6 #
7 # Populate a XFS filesystem and fuzz every leafn-format dir block field.
8 # Do not fix the filesystem, to test metadata verifiers.
9
10 . ./common/preamble
11 _begin_fstest dangerous_fuzzers dangerous_norepair
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 _disable_dmesg_check
24
25 echo "Format and populate"
26 _scratch_populate_cached nofill > $seqres.full 2>&1
27
28 echo "Find leafn-format dir block"
29 _scratch_mount
30 inum=$(stat -c '%i' $SCRATCH_MNT/S_IFDIR.FMT_NODE)
31 blk_sz=$(_get_block_size $SCRATCH_MNT)
32 _scratch_unmount
33
34 leaf_offset=$(( ( (2 ** 35) / blk_sz) + 1))
35 echo "Fuzz leafn-format dir block"
36 _scratch_xfs_fuzz_metadata '' 'none'  "inode ${inum}" "dblock ${leaf_offset}" >> $seqres.full
37 echo "Done fuzzing leafn-format dir block"
38
39 # success, all done
40 status=0
41 exit