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
28 [ "$XFS_FSR_PROG" = "" ] && _notrun "xfs_fsr not found"
30 # real QA test starts here
31 _scratch_unmount 2>/dev/null
32 MKFS_OPTIONS="-bsize=4096"
33 MOUNT_OPTIONS="-o noatime"
34 _scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs
37 echo Create some files
41 $XFS_IO_PROG -f -c "pwrite 0 512" $SCRATCH_MNT/${I} > /dev/null
45 # Roughly the middle of the created inodes
46 INO=`ls -i $SCRATCH_MNT/512 | awk '{print $1}'`
49 # Figure out where that middle inode starts
50 BYTE=`_scratch_xfs_db -c "convert inode $INO byte" \
51 | awk '{print $2}' | sed s/[\(\)]//g`
53 echo Blat inode clusters
54 $here/src/itrash $SCRATCH_DEV $BYTE
56 _try_scratch_mount || _fail "Couldn't mount after itrash"
58 echo Attempting bulkstat
59 #$here/src/bstat -q $SCRATCH_MNT
60 $XFS_FSR_PROG -g $SCRATCH_MNT | _filter_scratch
62 # Fix up intentional corruption so test can pass
64 _scratch_xfs_repair >> $seqres.full 2>&1