4 # To test out the noattr2 flag which is broken in pv#980021
5 # Given an existing attr2 filesystem, we should be able to mount
6 # as noattr2 and go back to an attr1 filesystem.
8 # Test the case where there are no more features2 bits on and
9 # so the morebitsbit should be off.
11 #-----------------------------------------------------------------------
12 # Copyright (c) 2008 Silicon Graphics, Inc. All Rights Reserved.
14 # This program is free software; you can redistribute it and/or
15 # modify it under the terms of the GNU General Public License as
16 # published by the Free Software Foundation.
18 # This program is distributed in the hope that it would be useful,
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 # GNU General Public License for more details.
23 # You should have received a copy of the GNU General Public License
24 # along with this program; if not, write the Free Software Foundation,
25 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27 #-----------------------------------------------------------------------
31 seqres=$RESULT_DIR/$seq
32 echo "QA output created by $seq"
36 status=1 # failure is the default!
37 trap "_cleanup; exit \$status" 0 1 2 3 15
47 tee -a $seqres.full | tr ',' '\n' | egrep 'ATTR|MORE|LAZY'
50 # get standard environment, filters and checks
55 # real QA test starts here
66 # Reset the options so that we can control what is going on here
67 export MKFS_OPTIONS=""
68 export MOUNT_OPTIONS=""
70 # lazysb, attr2 and other feature bits are held in features2 and will require
71 # morebitsbit on So test with lazysb and without it to see if the morebitsbit is
72 # okay etc. If the mkfs defaults change, these need to change as well.
73 MKFS_NO_LAZY="-m crc=0 -l lazy-count=0 -i projid32bit=0"
74 MKFS_LAZY="-m crc=0 -l lazy-count=1 -i projid32bit=0"
76 # ftype is also stored in features2, so we have to detect its presence in
77 # mkfs and disable it here too.
78 if _scratch_mkfs --help 2>&1 | grep -q "ftype="; then
79 MKFS_NO_LAZY="$MKFS_NO_LAZY -n ftype=0"
80 MKFS_LAZY="$MKFS_LAZY -n ftype=0"
83 # Make sure that when we think we are testing with morebits off
85 _scratch_mkfs -i attr=1 $MKFS_NO_LAZY >/dev/null 2>&1
86 _scratch_xfs_db -c version 2>&1 >$tmp.db
87 if grep -i morebits $tmp.db
90 echo "Need to update test $seq so that initial subtests do not use features2"
96 echo "*** 1. test attr2 mkfs and then noattr2 mount ***"
100 _scratch_mkfs -i attr=2 $MKFS_NO_LAZY >/dev/null 2>&1
101 _scratch_xfs_db -r -c version 2>&1 | _filter_version
105 _scratch_mount -o noattr2
106 $UMOUNT_PROG $SCRATCH_MNT
107 _scratch_xfs_db -r -c version 2>&1 | _filter_version
109 # adding an EA will ensure the ATTR1 flag is turned on
111 echo "*** 2. test attr2 mkfs and then noattr2 mount with 1 EA ***"
115 _scratch_mkfs -i attr=2 $MKFS_NO_LAZY >/dev/null 2>&1
116 _scratch_xfs_db -r -c version 2>&1 | _filter_version
120 _scratch_mount -o noattr2
123 $SETFATTR_PROG -n user.test -v 0xbabe testfile
124 $GETFATTR_PROG testfile
126 $UMOUNT_PROG $SCRATCH_MNT
127 _scratch_xfs_db -r -c version 2>&1 | _filter_version
130 echo "*** 3. test noattr2 mount and lazy sb ***"
135 _scratch_mkfs -i attr=2 $MKFS_LAZY >/dev/null 2>&1
136 _scratch_xfs_db -r -c version 2>&1 | _filter_version
140 _scratch_mount -o noattr2
144 $UMOUNT_PROG $SCRATCH_MNT
145 _scratch_xfs_db -r -c version 2>&1 | _filter_version