2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2013 Red Hat, Inc. All Rights Reserved.
7 # Test xfs_logprint w/ multiply-logged inodes & continued transactions
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
15 status=1 # failure is the default!
16 trap "_cleanup; exit \$status" 0 1 2 3 15
24 # get standard environment, filters and checks
29 # real QA test starts here
31 # Modify as appropriate.
39 logblks=$(_scratch_find_xfs_min_logblocks)
40 _scratch_mkfs -l size=${logblks}b >/dev/null 2>&1
42 # Should yield a multiply-logged inode, thanks to xattr
43 # Old logprint says this, then coredumps:
44 # xlog_print_trans_inode: illegal inode type
46 echo hello > $SCRATCH_MNT/hello; setfattr -n user.name -v value $SCRATCH_MNT/hello
48 _scratch_xfs_logprint 2>&1 >> $seqres.full
50 # Now go for a continued transaction
51 # The trick here is to get a transaction which is exactly the size of a
52 # xfs_inode_log_format_32_t or xfs_inode_log_format_64_t
53 # Prior to the bugfix, this was parsed like an inode due to the size
54 # match, not as a continued transaction. If that happens we'll see:
55 # xfs_logprint: unknown log operation type (494e)
57 _scratch_mkfs -l size=${logblks}b >/dev/null 2>&1
59 for I in `seq 0 8192`; do
60 echo a >> $SCRATCH_MNT/cat
61 touch $SCRATCH_MNT/tmp$I
64 _scratch_xfs_logprint 2>&1 >> $seqres.full