common.config minor changes
[xfstests-dev.git] / 118
1 #! /bin/sh
2 # FS QA Test No. 118
3 #
4 # To test out pv#940675 crash in xfs_trans_brelse + quotas
5 # Without the fix, this will create an ASSERT failure in debug kernels
6 # and crash a non-debug kernel.
7 #
8 #-----------------------------------------------------------------------
9 # Copyright (c) 2000-2005 Silicon Graphics, Inc.  All Rights Reserved.
10 #-----------------------------------------------------------------------
11 #
12 # creator
13 owner=tes@crackle.melbourne.sgi.com
14
15 seq=`basename $0`
16 echo "QA output created by $seq"
17
18 here=`pwd`
19 tmp=/tmp/$$
20 status=1        # failure is the default!
21 trap "_cleanup; exit \$status" 0 1 2 3 15
22
23 _cleanup()
24 {
25     cd /
26     rm -f $tmp.*
27 }
28
29 # get standard environment, filters and checks
30 . ./common.rc
31 . ./common.filter
32 . ./common.quota
33
34 # real QA test starts here
35
36 # Modify as appropriate.
37 _supported_fs xfs
38 _supported_os IRIX Linux
39
40 _require_scratch
41 _require_quota
42
43 _chowning_file()
44 {
45         file=file.chown
46         let start=$1
47         let limit=$2
48         let delta=$3
49
50         cd $SCRATCH_MNT
51         let count=$start
52         while (( count < limit )); do
53             touch $file
54             chown $count.$count $file
55             echo -n "."
56             let count=count+delta
57         done
58         echo ""
59 }
60
61
62 echo "mkfs on scratch"
63 _scratch_mkfs_xfs >$seq.full
64
65 echo "mount with quotas"
66 export MOUNT_OPTIONS="-o uquota"
67 _scratch_mount
68
69 echo "creating quota file with holes"
70 _chowning_file 1000 2000 100
71
72 echo "now fill in the holes"
73 _chowning_file 1000 2000 1
74
75 echo "look at the final file ownership for fun"
76 ls -l $SCRATCH_MNT/* \
77 | $AWK_PROG 'NF > 2 {print $3, $4, $NF}' \
78 | sed "s#$SCRATCH_MNT#SCRATCH_MNT#g"
79
80 # success, all done
81 status=0
82 exit