xfs/419: remove irrelevant swapfile test
[xfstests-dev.git] / tests / xfs / 121
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2006 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 121
6 #
7 # To test log replay for the unlinked list.
8 # So we create unlinked and still referenced inodes
9 # and make sure that no clearing of the unlinked AGI buckets
10 # are happening.
11 # See pv#953263.
12 #
13 seq=`basename $0`
14 seqres=$RESULT_DIR/$seq
15 echo "QA output created by $seq"
16
17 here=`pwd`
18 tmp=/tmp/$$
19 status=1        # failure is the default!
20 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
21
22 # get standard environment, filters and checks
23 . ./common/rc
24 . ./common/filter
25 . ./common/log
26
27 # real QA test starts here
28 _supported_fs xfs
29
30 rm -f $seqres.full
31 rm -f $tmp.log
32
33 _require_scratch
34
35 echo "mkfs"
36 _scratch_mkfs_xfs >>$seqres.full 2>&1 \
37     || _fail "mkfs scratch failed"
38
39 echo "mount"
40 _scratch_mount
41
42 # num_files must be greater than 64 (XFS_AGI_UNLINKED_BUCKETS)
43 # so that there will be at least one linked list from one of
44 # the 64 buckets, so that we can decode a di_next_unlinked field
45 num_files=200
46 delay=5
47 echo "open and unlink $num_files files"
48 $here/src/multi_open_unlink -f $SCRATCH_MNT/test_file -n $num_files -s $delay &
49
50 # time to create and unlink all the files
51 sleep 3
52
53 echo "godown"
54 _scratch_shutdown -v -f >> $seqres.full
55
56 # time for multi_open_unlink to exit out after its delay
57 # so we have no references and can unmount
58 wait 2>/dev/null
59
60 echo "unmount"
61 _scratch_unmount
62
63 echo "logprint after going down..."
64 _print_logstate
65
66 echo "mount with replay"
67 _try_scratch_mount $mnt >>$seqres.full 2>&1 \
68     || _fail "mount failed: $mnt $MOUNT_OPTIONS"
69
70 echo "godown"
71 _scratch_shutdown -v -f >> $seqres.full
72
73 echo "unmount"
74 _scratch_unmount
75
76 echo "logprint after going down..."
77 _print_logstate
78
79 echo "logprint to check for CLEAR_AGI_BUCKET..."
80 if _scratch_xfs_logprint -t | tee -a $seqres.full | grep CLEAR; then
81         echo 'CLEAR_AGI_BUCKET transactions found!!'
82         echo 'Are you running with an old xfs kernel - where the bug still exists?'
83 else
84         echo 'No CLEAR_AGI_BUCKET found in transactions - great - test passed :)'
85 fi
86
87 # clean up dirty log with log recovery on mount
88 _scratch_mount
89
90 # success, all done
91 status=0
92 exit