_scratch_mkfs -m crc=1,inobtcount=1,finobt=0 &> $seqres.full && \
echo "Should not be able to format with inobtcount but not finobt."
-# Make sure we can't upgrade a V4 filesystem
-_scratch_mkfs -m crc=0,inobtcount=0,finobt=0 >> $seqres.full
-_scratch_xfs_admin -O inobtcount=1 2>> $seqres.full
-_check_scratch_xfs_features INOBTCNT
-
# Make sure we can't upgrade a filesystem to inobtcount without finobt.
_scratch_mkfs -m crc=1,inobtcount=0,finobt=0 >> $seqres.full
_scratch_xfs_admin -O inobtcount=1 2>> $seqres.full
QA output created by 158
Running xfs_repair to upgrade filesystem.
-Inode btree count feature only supported on V5 filesystems.
-FEATURES: INOBTCNT:NO
-Running xfs_repair to upgrade filesystem.
Inode btree count feature requires free inode btree.
FEATURES: INOBTCNT:NO
Fail partway through upgrading
date --date='Jan 1 00:00:00 UTC 2040' > /dev/null 2>&1 || \
_notrun "Userspace does not support dates past 2038."
-# Make sure we can't upgrade a V4 filesystem
-_scratch_mkfs -m crc=0 >> $seqres.full
-_scratch_xfs_admin -O bigtime=1 2>> $seqres.full
-_check_scratch_xfs_features BIGTIME
-
# Make sure we're required to specify a feature status
_scratch_mkfs -m crc=1,bigtime=0,inobtcount=0 >> $seqres.full
_scratch_xfs_admin -O bigtime 2>> $seqres.full
QA output created by 160
Running xfs_repair to upgrade filesystem.
-Large timestamp feature only supported on V5 filesystems.
-FEATURES: BIGTIME:NO
-Running xfs_repair to upgrade filesystem.
Running xfs_repair to upgrade filesystem.
Adding inode btree counts to filesystem.
Adding large timestamp support to filesystem.
--- /dev/null
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2021 Oracle. All Rights Reserved.
+#
+# FS QA Test No. 612
+#
+# Check that we can upgrade v5 only features on a v4 file system
+
+. ./common/preamble
+_begin_fstest auto quick
+
+# Import common functions.
+. ./common/filter
+
+# real QA test starts here
+_supported_fs xfs
+_require_scratch_xfs_inobtcount
+_require_command "$XFS_ADMIN_PROG" "xfs_admin"
+_require_xfs_repair_upgrade inobtcount
+
+# Make sure we can't upgrade to inobt on a V4 filesystem
+_scratch_mkfs -m crc=0,inobtcount=0,finobt=0 >> $seqres.full
+_scratch_xfs_admin -O inobtcount=1 2>> $seqres.full
+_check_scratch_xfs_features INOBTCNT
+
+# Make sure we can't upgrade to bigtim on a V4 filesystem
+_scratch_mkfs -m crc=0 >> $seqres.full
+_scratch_xfs_admin -O bigtime=1 2>> $seqres.full
+_check_scratch_xfs_features BIGTIME
+
+status=0
+exit
--- /dev/null
+QA output created by 612
+Running xfs_repair to upgrade filesystem.
+Inode btree count feature only supported on V5 filesystems.
+FEATURES: INOBTCNT:NO
+Running xfs_repair to upgrade filesystem.
+Large timestamp feature only supported on V5 filesystems.
+FEATURES: BIGTIME:NO