fi
}
-# this test requires the projid32bit feature to be available in
-# mkfs.xfs
+# this test requires the projid32bit feature to be available in mkfs.xfs.
#
_require_projid32bit()
+{
+ _scratch_mkfs_xfs_supported -i projid32bit=1 >/dev/null 2>&1 \
+ || _notrun "mkfs.xfs doesn't have projid32bit feature"
+}
+
+_require_projid16bit()
{
_scratch_mkfs_xfs_supported -i projid32bit=0 >/dev/null 2>&1 \
- || _notrun "mkfs.xfs doesn't have projid32bit feature"
+ || _notrun "16 bit project IDs not supported on $SCRATCH_DEV"
}
# this test requires the crc feature to be available in mkfs.xfs
agsize=`xfs_info $loop_mnt | $SED_PROG -n 's/.*agsize=\(.*\) blks.*/\1/p'`
# Convert free space (agno, block, length) to (start sector, end sector)
$UMOUNT_PROG $loop_mnt
- $XFS_DB_PROG -c "freesp -d" $img_file | $SED_PROG '/^.*from/,$d'| \
+ $XFS_DB_PROG -r -c "freesp -d" $img_file | $SED_PROG '/^.*from/,$d'| \
$AWK_PROG -v spb=$sectors_per_block -v agsize=$agsize \
'{ print spb * ($1 * agsize + $2), spb * ($1 * agsize + $2 + $3) - 1 }'
;;
_require_scratch
_require_attrs
+_require_attr_v1
+_require_projid16bit
rm -f $seqres.full
-# lazysb and attr2 are in features2 and will require morebitsbit on
-# So test with lazysb and without it to see if the morebitsbit is
-# okay etc....
# Reset the options so that we can control what is going on here
export MKFS_OPTIONS=""
export MOUNT_OPTIONS=""
+# lazysb, attr2 and other feature bits are held in features2 and will require
+# morebitsbit on So test with lazysb and without it to see if the morebitsbit is
+# okay etc. If the mkfs defaults change, these need to change as well.
+export MKFS_NO_LAZY="-l lazy-count=0 -i projid32bit=0"
+export MKFS_LAZY="-l lazy-count=1 -i projid32bit=0"
+
# Make sure that when we think we are testing with morebits off
# that we really are.
-# Trying to future-proof in case mkfs defaults change.
-_scratch_mkfs -i attr=1 -l lazy-count=0 >/dev/null 2>&1
+_scratch_mkfs -i attr=1 $MKFS_NO_LAZY >/dev/null 2>&1
$XFS_DB_PROG -c version $SCRATCH_DEV 2>&1 >$tmp.db
if grep -i morebits $tmp.db
then
echo ""
echo "attr2 fs"
echo ""
-_scratch_mkfs -i attr=2 -l lazy-count=0 >/dev/null 2>&1
-$XFS_DB_PROG -c version $SCRATCH_DEV 2>&1 | _filter_version
+_scratch_mkfs -i attr=2 $MKFS_NO_LAZY >/dev/null 2>&1
+$XFS_DB_PROG -r -c version $SCRATCH_DEV 2>&1 | _filter_version
echo ""
echo "noattr2 fs"
echo ""
_scratch_mount -o noattr2
$UMOUNT_PROG $SCRATCH_MNT
-$XFS_DB_PROG -c version $SCRATCH_DEV 2>&1 | _filter_version
+$XFS_DB_PROG -r -c version $SCRATCH_DEV 2>&1 | _filter_version
# adding an EA will ensure the ATTR1 flag is turned on
echo ""
echo ""
echo "attr2 fs"
echo ""
-_scratch_mkfs -i attr=2 -l lazy-count=0 >/dev/null 2>&1
-$XFS_DB_PROG -c version $SCRATCH_DEV 2>&1 | _filter_version
+_scratch_mkfs -i attr=2 $MKFS_NO_LAZY >/dev/null 2>&1
+$XFS_DB_PROG -r -c version $SCRATCH_DEV 2>&1 | _filter_version
echo ""
echo "noattr2 fs"
echo ""
$GETFATTR_PROG testfile
cd $here
$UMOUNT_PROG $SCRATCH_MNT
-$XFS_DB_PROG -c version $SCRATCH_DEV 2>&1 | _filter_version
+$XFS_DB_PROG -r -c version $SCRATCH_DEV 2>&1 | _filter_version
echo ""
echo "*** 3. test noattr2 mount and lazy sb ***"
echo ""
echo "attr2 fs"
echo ""
-_scratch_mkfs -i attr=2 -l lazy-count=1 >/dev/null 2>&1
-$XFS_DB_PROG -c version $SCRATCH_DEV 2>&1 | _filter_version
+_scratch_mkfs -i attr=2 $MKFS_LAZY >/dev/null 2>&1
+$XFS_DB_PROG -r -c version $SCRATCH_DEV 2>&1 | _filter_version
echo ""
echo "noattr2 fs"
echo ""
touch testfile
cd $here
$UMOUNT_PROG $SCRATCH_MNT
-$XFS_DB_PROG -c version $SCRATCH_DEV 2>&1 | _filter_version
+$XFS_DB_PROG -r -c version $SCRATCH_DEV 2>&1 | _filter_version
# success, all done
status=0