2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2018 Red Hat, Inc. All Rights Reserved.
7 # Catch inobt/on disk inode free state mismatches on V4 filesystems
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
15 status=1 # failure is the default!
16 trap "_cleanup; exit \$status" 0 1 2 3 15
24 # get standard environment, filters and checks
29 # remove previous $seqres.full before test
32 # real QA test starts here
37 # we intentionally corrupt the filesystem, so don't check it after the test
38 _require_scratch_nocheck
40 # on success, we'll get a shutdown filesystem with a really noisy log message
41 # due to transaction cancellation. Hence we don't want to check dmesg here.
45 _scratch_mkfs -m crc=0 > $seqres.full 2>&1
47 # The files that EIO in the golden output changes if we have quotas enabled
49 _qmount_option "defaults"
51 # corrupt an inode in the root inode chunk
52 root_ino=$(_scratch_xfs_get_metadata_field 'rootino' 'sb 0')
53 corrupt_ino=$((root_ino + 15))
54 _scratch_xfs_set_metadata_field 'core.mode' 0100644 "inode $corrupt_ino"
58 # The corrupt inode should be tripped over during these initial file creates.
59 touch $SCRATCH_MNT/file{0,1,2,3,4,5}{0,1,2,3,4,5} 2>&1 | _filter_scratch