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