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 _begin_fstest shutdown log auto quick
16 # Import common functions.
20 # real QA test starts here
28 _scratch_mkfs_xfs >>$seqres.full 2>&1 \
29 || _fail "mkfs scratch failed"
34 # num_files must be greater than 64 (XFS_AGI_UNLINKED_BUCKETS)
35 # so that there will be at least one linked list from one of
36 # the 64 buckets, so that we can decode a di_next_unlinked field
39 echo "open and unlink $num_files files"
40 $here/src/multi_open_unlink -f $SCRATCH_MNT/test_file -n $num_files -s $delay &
42 # time to create and unlink all the files
46 _scratch_shutdown -v -f >> $seqres.full
48 # time for multi_open_unlink to exit out after its delay
49 # so we have no references and can unmount
55 echo "logprint after going down..."
58 echo "mount with replay"
59 _try_scratch_mount $mnt >>$seqres.full 2>&1 \
60 || _fail "mount failed: $mnt $MOUNT_OPTIONS"
63 _scratch_shutdown -v -f >> $seqres.full
68 echo "logprint after going down..."
71 echo "logprint to check for CLEAR_AGI_BUCKET..."
72 if _scratch_xfs_logprint -t | tee -a $seqres.full | grep CLEAR; then
73 echo 'CLEAR_AGI_BUCKET transactions found!!'
74 echo 'Are you running with an old xfs kernel - where the bug still exists?'
76 echo 'No CLEAR_AGI_BUCKET found in transactions - great - test passed :)'
79 # clean up dirty log with log recovery on mount