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 _begin_fstest ioctl dump auto quick
14 # Override the default cleanup function.
18 rm -f $TEST_DIR/dumpfile
22 # Perform a level 0 dump that respects the chattr dump exclude flag,
23 # and grep the output for the inode number we expect / do not expect
26 # Only dump a subtree so we get away with a single partition for
27 # the subtree to be dumped and the dump file.
31 $XFSDUMP_PROG -l 0 -s d -F \
33 -f $TEST_DIR/dumpfile -v excluded_files=debug $TEST_DIR \
35 | 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/'
38 # Import common functions.
41 # real QA test starts here
46 _require_command "$XFSDUMP_PROG" xfsdump
48 echo "Preparing subtree"
51 inum=`stat -c "%i" $TEST_DIR/d/t`
53 echo "No dump exclude flag set (should not be skipped)"
56 echo "Dump exclude flag set, but no sync yet (should be skipped)"
57 $CHATTR_PROG +d $TEST_DIR/d/t
60 echo "Dump exclude flag set, after sync (should be skipped)"