fsx: Replace use of bzero() with memset()
[xfstests-dev.git] / 181
1 #! /bin/sh
2 # FS QA Test No. 181
3 #
4 # Like 121 only creating large EAs
5 # As part of the iunlink processing in recovery it will call VN_RELE
6 # which will inactivate the inodes and if they have EAs (which they
7 # will here) also call xfs_inactive_attrs.
8 # We want to test out this xfs_inactive_attrs code being called in recovery.
9 #
10 #-----------------------------------------------------------------------
11 # Copyright (c) 2007 Silicon Graphics, Inc.  All Rights Reserved.
12 #-----------------------------------------------------------------------
13 #
14 # creator
15 owner=tes@sgi.com
16
17 seq=`basename $0`
18 echo "QA output created by $seq"
19
20 _cleanup()
21 {
22     rm -f $tmp.*
23     [ -n "$pid" ] && kill $pid
24 }
25
26 pid=""
27 here=`pwd`
28 tmp=/tmp/$$
29 status=1        # failure is the default!
30 trap "_cleanup; exit \$status" 0 1 2 3 15
31
32 # get standard environment, filters and checks
33 . ./common.rc
34 . ./common.filter
35 . ./common.log
36
37 # real QA test starts here
38 _supported_fs xfs
39 _supported_os IRIX Linux
40
41 rm -f $seq.full
42 rm -f $tmp.log
43
44 _require_scratch
45
46 echo "mkfs"
47 _scratch_mkfs_xfs >>$seq.full 2>&1 \
48     || _fail "mkfs scratch failed"
49
50 echo "mount"
51 _scratch_mount >>$seq.full 2>&1 \
52     || _fail "mount failed: $MOUNT_OPTIONS"
53
54 # num_files must be greater than 64 (XFS_AGI_UNLINKED_BUCKETS)
55 # so that there will be at least one linked list from one of
56 # the 64 buckets, so that we can decode a di_next_unlinked field
57 num_files=200
58 num_eas=1
59 ea_val_size=`expr 32 \* 1024`
60
61 # sleep for ages and we will kill this pid when we are ready
62 delay=100
63
64 echo "open and unlink $num_files files with EAs"
65 src/multi_open_unlink -f $SCRATCH_MNT/test_file -n $num_files -s $delay -e $num_eas -v $ea_val_size &
66 pid=$!
67
68 # time to create and unlink all the files
69 sleep 10
70
71 echo "godown"
72 src/godown -v -f $SCRATCH_MNT >> $seq.full
73
74 # kill the multi_open_unlink
75 kill $pid 2>/dev/null
76 wait $pid 2>/dev/null
77 pid=""
78
79 echo "unmount"
80 umount $SCRATCH_MNT
81
82 echo "logprint after going down..."
83 _print_logstate
84
85 echo "mount with replay"
86 _scratch_mount $mnt >>$seq.full 2>&1 \
87     || _fail "mount failed: $mnt $MOUNT_OPTIONS"
88
89 echo "godown"
90 src/godown -v -f $SCRATCH_MNT >> $seq.full
91
92 echo "unmount"
93 umount $SCRATCH_MNT
94
95 echo "logprint after going down..."
96 _print_logstate
97
98 echo "logprint to check for CLEAR_AGI_BUCKET..."
99 if _scratch_xfs_logprint -t | tee -a $seq.full | grep CLEAR; then
100         echo 'CLEAR_AGI_BUCKET transactions found!!'
101         echo 'Are you running with an old xfs kernel - where the bug still exists?'
102 else
103         echo 'No CLEAR_AGI_BUCKET found in transactions - great - test passed :)'
104 fi
105
106 # clean up dirty log with log recovery on mount
107 _scratch_mount >> $seq.full 2>&1 \
108     || _fail "mount failed"
109
110 # should now be peaches
111 _check_scratch_fs
112
113 # success, all done
114 status=0
115 exit