2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
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
14 seqres=$RESULT_DIR/$seq
15 echo "QA output created by $seq"
19 status=1 # failure is the default!
20 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
22 # get standard environment, filters and checks
27 # real QA test starts here
36 _scratch_mkfs_xfs >>$seqres.full 2>&1 \
37 || _fail "mkfs scratch failed"
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
47 echo "open and unlink $num_files files"
48 $here/src/multi_open_unlink -f $SCRATCH_MNT/test_file -n $num_files -s $delay &
50 # time to create and unlink all the files
54 _scratch_shutdown -v -f >> $seqres.full
56 # time for multi_open_unlink to exit out after its delay
57 # so we have no references and can unmount
63 echo "logprint after going down..."
66 echo "mount with replay"
67 _try_scratch_mount $mnt >>$seqres.full 2>&1 \
68 || _fail "mount failed: $mnt $MOUNT_OPTIONS"
71 _scratch_shutdown -v -f >> $seqres.full
76 echo "logprint after going down..."
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?'
84 echo 'No CLEAR_AGI_BUCKET found in transactions - great - test passed :)'
87 # clean up dirty log with log recovery on mount