3 #-----------------------------------------------------------------------
4 # Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License as
8 # published by the Free Software Foundation.
10 # This program is distributed in the hope that it would be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write the Free Software Foundation,
17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #-----------------------------------------------------------------------
23 # To test log replay for the unlinked list.
24 # So we create unlinked and still referenced inodes
25 # and make sure that no clearing of the unlinked AGI buckets
33 echo "QA output created by $seq"
37 status=1 # failure is the default!
38 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
40 # get standard environment, filters and checks
45 # real QA test starts here
47 _supported_os IRIX Linux
55 _scratch_mkfs_xfs >>$seq.full 2>&1 \
56 || _fail "mkfs scratch failed"
59 _scratch_mount >>$seq.full 2>&1 \
60 || _fail "mount failed: $MOUNT_OPTIONS"
62 # num_files must be greater than 64 (XFS_AGI_UNLINKED_BUCKETS)
63 # so that there will be at least one linked list from one of
64 # the 64 buckets, so that we can decode a di_next_unlinked field
67 echo "open and unlink $num_files files"
68 src/multi_open_unlink -f $SCRATCH_MNT/test_file -n $num_files -s $delay &
70 # time to create and unlink all the files
74 src/godown -v -f $SCRATCH_MNT >> $seq.full
76 # time for multi_open_unlink to exit out after its delay
77 # so we have no references and can unmount
83 echo "logprint after going down..."
86 echo "mount with replay"
87 _scratch_mount $mnt >>$seq.full 2>&1 \
88 || _fail "mount failed: $mnt $MOUNT_OPTIONS"
91 src/godown -v -f $SCRATCH_MNT >> $seq.full
96 echo "logprint after going down..."
99 echo "logprint to check for CLEAR_AGI_BUCKET..."
100 if _scratch_xfs_logprint -t | tee -a $seq.full | grep CLEAR; then
101 echo 'CLEAR_AGI_BUCKET transactions found!!'
102 echo 'Are you running with an old xfs kernel - where the bug still exists?'
104 echo 'No CLEAR_AGI_BUCKET found in transactions - great - test passed :)'
107 # clean up dirty log with log recovery on mount
108 _scratch_mount >> $seq.full 2>&1 \
109 || _fail "mount failed"
111 # should now be peaches