export SELINUX_MOUNT_OPTIONS
fi
-# check if mkfs.xfs supports v5 xfs
-if [ "$FSTYP" == "xfs" ]; then
- XFS_MKFS_HAS_NO_META_SUPPORT=""
- touch /tmp/crc_check.img
- $MKFS_XFS_PROG -N -d file,name=/tmp/crc_check.img,size=32m -m crc=0 \
- >/dev/null 2>&1;
- if [ $? -ne 0 ]; then
- XFS_MKFS_HAS_NO_META_SUPPORT=true
- fi
- rm -f /tmp/crc_check.img
- export XFS_MKFS_HAS_NO_META_SUPPORT
-fi
-
_common_mount_opts()
{
case $FSTYP in
{
mkfs_opts=$*
- # remove metadata related mkfs options if mkfs.xfs doesn't them
- if [ -n "$XFS_MKFS_HAS_NO_META_SUPPORT" ]; then
- mkfs_opts=`echo $mkfs_opts | sed "s/-m\s\+\S\+//g"`
- fi
-
_scratch_options mkfs
echo "$MKFS_XFS_PROG $SCRATCH_OPTIONS $mkfs_opts"
|| _notrun "16 bit project IDs not supported on $SCRATCH_DEV"
}
-# this test requires the crc feature to be available in mkfs.xfs
-#
-_require_xfs_mkfs_crc()
-{
- _scratch_mkfs_xfs_supported -m crc=1 >/dev/null 2>&1 \
- || _notrun "mkfs.xfs doesn't have crc feature"
-}
-
-# this test requires the xfs kernel support crc feature
-#
-_require_xfs_crc()
-{
- _scratch_mkfs_xfs -m crc=1 >/dev/null 2>&1
- _try_scratch_mount >/dev/null 2>&1 \
- || _notrun "Kernel doesn't support crc feature"
- _scratch_unmount
-}
-
# If the xfs_info output for the given XFS filesystem mount mentions the given
# feature. If so, return 0 for success. If not, return 1 for failure. If the
# third option is -v, echo 1 for success and 0 for not.
#
_require_meta_uuid()
{
- # This will create a crc fs on $SCRATCH_DEV
- _require_xfs_crc
-
_scratch_xfs_db -x -c "uuid restore" 2>&1 \
| grep -q "invalid UUID\|supported on V5 fs" \
&& _notrun "Userspace doesn't support meta_uuid feature"
_require_scratch_nocheck
_require_no_large_scratch_dev
-# So we can explicitly turn it _off_:
-_require_xfs_mkfs_crc
-
_scratch_mkfs_xfs -m crc=0 -d size=128m >> $seqres.full 2>&1 || _fail "mkfs failed"
# Scribble past a couple V4 secondary superblocks to populate sb_crc
_supported_fs xfs
_require_scratch_nocheck
-_require_xfs_mkfs_crc
_scratch_mkfs_xfs -m crc=1 >> $seqres.full 2>&1 || _fail "mkfs failed"
_require_xfs_copy
_require_scratch
_require_no_large_scratch_dev
-_require_xfs_crc
_require_meta_uuid
# Takes 2 args, 2nd optional:
_supported_fs xfs
_require_scratch
-#_require_xfs_crc # checksum not required, but you probably want it anyway...
-#_require_xfs_mkfs_crc
_require_attrs
_require_populate_commands
# due to transaction cancellation. Hence we don't want to check dmesg here.
_disable_dmesg_check
-_require_xfs_mkfs_crc
_scratch_mkfs -m crc=0 > $seqres.full 2>&1
# The files that EIO in the golden output changes if we have quotas enabled
_supported_fs xfs
_require_test
_require_attrs
-_require_xfs_mkfs_crc
_disable_dmesg_check
imgfile=$TEST_DIR/img-$seq
_require_scratch
_require_xfs_quota
-# We could test older, non-project capable kernels but keep it simpler;
-# Only test crc and beyond (but we will test with and without the feature)
-_require_xfs_mkfs_crc
-_require_xfs_crc
-
function option_string()
{
VAL=$1
_require_scratch
_require_xfs_quota
-_require_xfs_mkfs_crc
-_require_xfs_crc
# The actual point at which limit enforcement takes place for the
# hard block limit is variable depending on filesystem blocksize,
_require_scratch
_require_xfs_quota
-_require_xfs_mkfs_crc
-_require_xfs_crc
_scratch_mkfs_xfs -m crc=1 >/dev/null 2>&1
_require_scratch
_require_xfs_quota
-_require_xfs_mkfs_crc
-_require_xfs_crc
_require_command "$KILLALL_PROG" killall
_scratch_mkfs_xfs -m crc=1 >/dev/null 2>&1