3 #-----------------------------------------------------------------------
4 # Copyright (c) 2008 Silicon Graphics, Inc. All Rights Reserved.
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License as
8 # published by the Free Software Foundation.
10 # This program is distributed in the hope that it would be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write the Free Software Foundation,
17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #-----------------------------------------------------------------------
23 # To test out the noattr2 flag which is broken in pv#980021
24 # Given an existing attr2 filesystem, we should be able to mount
25 # as noattr2 and go back to an attr1 filesystem.
27 # Test the case where there are no more features2 bits on and
28 # so the morebitsbit should be off.
31 owner=tes@emu.melbourne.sgi.com
34 echo "QA output created by $seq"
38 status=1 # failure is the default!
39 trap "_cleanup; exit \$status" 0 1 2 3 15
49 tee -a $seq.full | tr ',' '\n' | egrep 'ATTR|MORE|LAZY'
52 # get standard environment, filters and checks
56 # real QA test starts here
62 # lazysb and attr2 are in features2 and will require morebitsbit on
63 # So test with lazysb and without it to see if the morebitsbit is
65 # Reset the options so that we can control what is going on here
66 export MKFS_OPTIONS=""
67 export MOUNT_OPTIONS=""
69 # Make sure that when we think we are testing with morebits off
71 # Trying to future-proof in case mkfs defaults change.
72 _scratch_mkfs -i attr=1 >/dev/null 2>&1
73 $XFS_DB_PROG -c version $SCRATCH_DEV 2>&1 >$tmp.db
74 if grep -i morebits $tmp.db
77 echo "Need to update test $seq so that initial subtests do not use features2"
83 echo "*** 1. test attr2 mkfs and then noattr2 mount ***"
87 _scratch_mkfs -i attr=2 -l lazy-count=0 >/dev/null 2>&1
88 $XFS_DB_PROG -c version $SCRATCH_DEV 2>&1 | _filter_version
92 _scratch_mount -o noattr2
93 $UMOUNT_PROG $SCRATCH_MNT
94 $XFS_DB_PROG -c version $SCRATCH_DEV 2>&1 | _filter_version
96 # adding an EA will ensure the ATTR1 flag is turned on
98 echo "*** 2. test attr2 mkfs and then noattr2 mount with 1 EA ***"
102 _scratch_mkfs -i attr=2 -l lazy-count=0 >/dev/null 2>&1
103 $XFS_DB_PROG -c version $SCRATCH_DEV 2>&1 | _filter_version
107 _scratch_mount -o noattr2
110 setfattr -n user.test -v 0xbabe testfile
113 $UMOUNT_PROG $SCRATCH_MNT
114 $XFS_DB_PROG -c version $SCRATCH_DEV 2>&1 | _filter_version
117 echo "*** 3. test noattr2 mount and lazy sb ***"
122 _scratch_mkfs -i attr=2 -l lazy-count=1 >/dev/null 2>&1
123 $XFS_DB_PROG -c version $SCRATCH_DEV 2>&1 | _filter_version
127 _scratch_mount -o noattr2
131 $UMOUNT_PROG $SCRATCH_MNT
132 $XFS_DB_PROG -c version $SCRATCH_DEV 2>&1 | _filter_version