2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2008 Christoph Hellwig.
7 # Make sure the chattr dump flag gets picked up by xfsdump without a sync
9 # http://oss.sgi.com/bugzilla/show_bug.cgi?id=340
12 seqres=$RESULT_DIR/$seq
13 echo "QA output created by $seq"
17 status=1 # failure is the default!
22 rm -f $TEST_DIR/dumpfile
24 trap "_cleanup; exit \$status" 0 1 2 3 15
27 # Perform a level 0 dump that respects the chattr dump exclude flag,
28 # and grep the output for the inode number we expect / do not expect
31 # Only dump a subtree so we get away with a single partition for
32 # the subtree to be dumped and the dump file.
36 $XFSDUMP_PROG -l 0 -s d -F \
38 -f $TEST_DIR/dumpfile -v excluded_files=debug $TEST_DIR \
40 | sed -e 's/.*xfsdump: pruned ino [0-9]*, owner 0, estimated size 0: skip flag set/xfsdump: pruned ino NNN, owner 0, estimated size 0: skip flag set/'
43 # get standard environment, filters and checks
47 # real QA test starts here
53 _require_command "$XFSDUMP_PROG" xfsdump
55 echo "Preparing subtree"
58 inum=`stat -c "%i" $TEST_DIR/d/t`
60 echo "No dump exclude flag set (should not be skipped)"
63 echo "Dump exclude flag set, but no sync yet (should be skipped)"
64 $CHATTR_PROG +d $TEST_DIR/d/t
67 echo "Dump exclude flag set, after sync (should be skipped)"