4 # Check that the features2 location fixups work correctly. We check both
5 # a regular read-write mount of a filesystem and the case where the
6 # filesystem is first mounted read-only and then later remounted read-write,
7 # which is the usual case for the root filesystem.
9 #-----------------------------------------------------------------------
10 # Copyright (c) 2008 Christoph Hellwig.
12 # This program is free software; you can redistribute it and/or
13 # modify it under the terms of the GNU General Public License as
14 # published by the Free Software Foundation.
16 # This program is distributed in the hope that it would be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write the Free Software Foundation,
23 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 #-----------------------------------------------------------------------
28 seqres=$RESULT_DIR/$seq
29 seqres=$RESULT_DIR/$seq
30 seqres=$RESULT_DIR/$seq
31 echo "QA output created by $seq"
35 status=1 # failure is the default!
40 umount $SCRATCH_MNT >/dev/null 2>&1
42 trap "_cleanup; exit \$status" 0 1 2 3 15
44 # get standard environment, filters and checks
48 # real QA test starts here
54 _scratch_mkfs_xfs -l lazy-count=1 >/dev/null 2>&1
57 # Print the current flags. Just a dummy so that the test breaks
58 # in an obvious way when the default feature flags changed in mkfs
60 echo "Default feature2 flags:"
61 xfs_db -x $SCRATCH_DEV -c 'sb' -c 'print features2'
62 xfs_db -x $SCRATCH_DEV -c 'sb' -c 'print bad_features2'
65 # Now clear the normal flags
67 echo "Clearing features2:"
68 xfs_db -x $SCRATCH_DEV -c 'sb' -c 'write features2 0'
72 echo "Features 2 after mount rw:"
73 xfs_db -x $SCRATCH_DEV -c 'sb' -c 'print features2'
76 # Clear the normal flags again for the second rount.
78 echo "Clearing features2:"
79 xfs_db -x $SCRATCH_DEV -c 'sb' -c 'write features2 0'
82 # And print the flags after a mount ro and remount rw
85 _scratch_mount -o remount,rw
87 echo "Features 2 after mount ro and remount rw:"
88 xfs_db -x $SCRATCH_DEV -c 'sb' -c 'print features2'