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 #-----------------------------------------------------------------------
30 owner=tes@emu.melbourne.sgi.com
33 echo "QA output created by $seq"
37 status=1 # failure is the default!
38 trap "_cleanup; exit \$status" 0 1 2 3 15
48 tee -a $seq.full | tr ',' '\n' | egrep 'ATTR|MORE|LAZY'
51 # get standard environment, filters and checks
56 # real QA test starts here
65 # lazysb and attr2 are in features2 and will require morebitsbit on
66 # So test with lazysb and without it to see if the morebitsbit is
68 # Reset the options so that we can control what is going on here
69 export MKFS_OPTIONS=""
70 export MOUNT_OPTIONS=""
72 # Make sure that when we think we are testing with morebits off
74 # Trying to future-proof in case mkfs defaults change.
75 _scratch_mkfs -i attr=1 -l lazy-count=0 >/dev/null 2>&1
76 $XFS_DB_PROG -c version $SCRATCH_DEV 2>&1 >$tmp.db
77 if grep -i morebits $tmp.db
80 echo "Need to update test $seq so that initial subtests do not use features2"
86 echo "*** 1. test attr2 mkfs and then noattr2 mount ***"
90 _scratch_mkfs -i attr=2 -l lazy-count=0 >/dev/null 2>&1
91 $XFS_DB_PROG -c version $SCRATCH_DEV 2>&1 | _filter_version
95 _scratch_mount -o noattr2
96 $UMOUNT_PROG $SCRATCH_MNT
97 $XFS_DB_PROG -c version $SCRATCH_DEV 2>&1 | _filter_version
99 # adding an EA will ensure the ATTR1 flag is turned on
101 echo "*** 2. test attr2 mkfs and then noattr2 mount with 1 EA ***"
105 _scratch_mkfs -i attr=2 -l lazy-count=0 >/dev/null 2>&1
106 $XFS_DB_PROG -c version $SCRATCH_DEV 2>&1 | _filter_version
110 _scratch_mount -o noattr2
113 $SETFATTR_PROG -n user.test -v 0xbabe testfile
114 $GETFATTR_PROG testfile
116 $UMOUNT_PROG $SCRATCH_MNT
117 $XFS_DB_PROG -c version $SCRATCH_DEV 2>&1 | _filter_version
120 echo "*** 3. test noattr2 mount and lazy sb ***"
125 _scratch_mkfs -i attr=2 -l lazy-count=1 >/dev/null 2>&1
126 $XFS_DB_PROG -c version $SCRATCH_DEV 2>&1 | _filter_version
130 _scratch_mount -o noattr2
134 $UMOUNT_PROG $SCRATCH_MNT
135 $XFS_DB_PROG -c version $SCRATCH_DEV 2>&1 | _filter_version