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 _begin_fstest auto quick metadata repair
13 # Import common functions.
16 echo "Silence is golden"
18 # real QA test starts here
20 # Modify as appropriate.
24 _scratch_mkfs >> /dev/null 2>&1
26 rootino=$(_scratch_xfs_get_metadata_field 'rootino' 'sb 0')
28 prefix=$(_scratch_get_sfdir_prefix ${rootino} || \
29 _fail "Cannot determine sfdir prefix")
31 # Corrupt root inode parent pointer
32 _scratch_xfs_set_metadata_field "${prefix}.hdr.parent.i4" 0 "inode ${rootino}"\
35 _scratch_xfs_repair >> $seqres.full 2>&1
37 # Post-test integrity check will detect any remaining corruption