4 # exercise xfs_repair repairing broken filesystems (root inodes)
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
8 #-----------------------------------------------------------------------
14 echo "QA output created by $seq"
18 status=1 # failure is the default!
23 umount $SCRATCH_DEV 2>/dev/null
27 trap "_cleanup; exit \$status" 0 1 2 3 15
29 # get standard environment, filters and checks
34 # link correct .out file
35 _link_out_file $seq.out
37 # nuke the root, rt bitmap, and rt summary inodes
41 echo "Corrupting root inode - setting bits to $1"
42 _check_repair $1 "inode $rootino"
43 echo "Corrupting rt bitmap inode - setting bits to $1"
44 _check_repair $1 "inode $rbmino"
45 echo "Corrupting rt summary inode - setting bits to $1"
46 _check_repair $1 "inode $rsumino"
51 # IRIX checks for valid user and group ids as we have a
53 # As it is unsigned on Linux, this test is not done
54 # (i.e. -1 is a valid id on Linux but not on IRIX)
55 # So we make the output the same for both OS's.
59 egrep -v 'bad user id 0xffffffff|bad group id 0xffffffff'
62 # real QA test starts here
64 _supported_os IRIX Linux
69 # devzero blows away 512byte blocks, so make 512byte inodes (at least)
70 _scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs
72 [ $isize -lt 512 ] && \
73 _scratch_mkfs_xfs -isize=512 | _filter_mkfs >/dev/null 2>&1
75 `xfs_db -r -c sb -c p $SCRATCH_DEV | grep 'ino = ' | \
76 sed -e 's/ //g' -e 's/^/export /'`
78 # check we won't get any quota inodes setup on mount
80 src/feature -U $SCRATCH_DEV && \
81 _notrun "UQuota are enabled, test needs controlled sb recovery"
82 src/feature -G $SCRATCH_DEV && \
83 _notrun "GQuota are enabled, test needs controlled sb recovery"
84 src/feature -P $SCRATCH_DEV && \
85 _notrun "PQuota are enabled, test needs controlled sb recovery"
88 # rootino, rbmino, and rsumino are now set (lets blow em away!)
90 _check_root_inos -1 | _filter_bad_ids