2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2018 Red Hat Inc. All Rights Reserved.
7 # Make sure xfs_repair can repair root inode parent's pointer
8 # when it contains a bogus ino when it's using shot form directory
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 15
25 # get standard environment, filters and checks
29 # remove previous $seqres.full before test
32 echo "Silence is golden"
34 # real QA test starts here
36 # Modify as appropriate.
40 _scratch_mkfs >> /dev/null 2>&1
42 rootino=$(_scratch_xfs_get_metadata_field 'rootino' 'sb 0')
44 prefix=$(_scratch_get_sfdir_prefix ${rootino} || \
45 _fail "Cannot determine sfdir prefix")
47 # Corrupt root inode parent pointer
48 _scratch_xfs_set_metadata_field "${prefix}.hdr.parent.i4" 0 "inode ${rootino}"\
51 _scratch_xfs_repair >> $seqres.full 2>&1
53 # Post-test integrity check will detect any remaining corruption