2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
7 # Infinite xfs_bulkstat bad-inode loop case from Roger Willcocks.
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
15 status=1 # failure is the default!
16 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
18 # get standard environment, filters and checks
22 # real QA test starts here
29 [ "$XFS_FSR_PROG" = "" ] && _notrun "xfs_fsr not found"
31 # real QA test starts here
32 _scratch_unmount 2>/dev/null
33 MKFS_OPTIONS="-bsize=4096"
34 MOUNT_OPTIONS="-o noatime"
35 _scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs
38 echo Create some files
42 $XFS_IO_PROG -f -c "pwrite 0 512" $SCRATCH_MNT/${I} > /dev/null
46 # Roughly the middle of the created inodes
47 INO=`ls -i $SCRATCH_MNT/512 | awk '{print $1}'`
50 # Figure out where that middle inode starts
51 BYTE=`_scratch_xfs_db -c "convert inode $INO byte" \
52 | awk '{print $2}' | sed s/[\(\)]//g`
54 echo Blat inode clusters
55 $here/src/itrash $SCRATCH_DEV $BYTE
57 _try_scratch_mount || _fail "Couldn't mount after itrash"
59 echo Attempting bulkstat
60 #$here/src/bstat -q $SCRATCH_MNT
61 $XFS_FSR_PROG -g $SCRATCH_MNT | _filter_scratch
63 # Fix up intentional corruption so test can pass
65 _scratch_xfs_repair >> $seqres.full 2>&1