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 echo "QA output created by $seq"
33 status=1 # failure is the default!
38 umount $SCRATCH_MNT >/dev/null 2>&1
40 trap "_cleanup; exit \$status" 0 1 2 3 15
42 # get standard environment, filters and checks
46 # real QA test starts here
54 xfs_db -x $SCRATCH_DEV -c "sb" -c "print $1" | awk '// {print $3}'
57 # clear any mkfs options so that we can directly specify the options we need to
58 # be able to test the features bitmask behaviour correctly.
60 _scratch_mkfs_xfs -m crc=0 -l lazy-count=1 >/dev/null 2>&1
62 # Grab the initial configuration. This checks mkfs sets the fields properly, and
63 # gives us the values the resultant tests should be the same as for testing at
64 # the end of the test. We don't hard code feature values, because that makes the
65 # test break every time we change mkfs feature defaults.
66 f2=`get_features features2`
67 bf2=`get_features bad_features2`
70 # Now clear the normal flags
72 echo "Clearing features2:"
73 xfs_db -x $SCRATCH_DEV -c 'sb' -c 'write features2 0'
77 rwf2=`get_features features2`
80 # Clear the normal flags again for the second rount.
82 echo "Clearing features2:"
83 xfs_db -x $SCRATCH_DEV -c 'sb' -c 'write features2 0'
86 # And print the flags after a mount ro and remount rw
89 _scratch_mount -o remount,rw
91 rof2=`get_features features2`
93 [ "$f2" != "$bf2" ] && echo "mkfs: features2 $f2 != bad_features2 $bf2"
94 [ "$f2" != "$rwf2" ] && echo "mount rw: old features2 $f2 != new features2 $rwf2"
95 [ "$f2" != "$rof2" ] && echo "ro->rw: old features2 $f2 != new features2 $rof2"