summaryrefslogtreecommitdiff
path: root/common/xfs
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2021-04-27 21:08:33 -0700
committerEryu Guan <guaneryu@gmail.com>2021-05-09 22:37:50 +0800
commit2837d7c32d701310e663c66b5fb2b4cdad686763 (patch)
treeaae33d04b051137dbf91462e1cda09111481c8a8 /common/xfs
parent05dc92277171ef01f6a55ac193df8eb067c779b9 (diff)
xfs: test upgrading filesystem to bigtime
Test that we can upgrade an existing filesystem to use bigtime. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Amir Goldstein <amir73il@gmail.com> (xfs/908 only) Reviewed-by: Allison Henderson <allison.henderson@oracle.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Diffstat (limited to 'common/xfs')
-rw-r--r--common/xfs16
1 files changed, 16 insertions, 0 deletions
diff --git a/common/xfs b/common/xfs
index 559d0046..ce49057c 100644
--- a/common/xfs
+++ b/common/xfs
@@ -1185,3 +1185,19 @@ _xfs_timestamp_range()
awk '{printf("%s %s", $1, $2);}'
fi
}
+
+# Require that the scratch device exists, that mkfs can format with bigtime
+# enabled, that the kernel can mount such a filesystem, and that xfs_info
+# advertises the presence of that feature.
+_require_scratch_xfs_bigtime()
+{
+ _require_scratch
+
+ _scratch_mkfs -m bigtime=1 &>/dev/null || \
+ _notrun "mkfs.xfs doesn't support bigtime feature"
+ _try_scratch_mount || \
+ _notrun "kernel doesn't support xfs bigtime feature"
+ $XFS_INFO_PROG "$SCRATCH_MNT" | grep -q -w "bigtime=1" || \
+ _notrun "bigtime feature not advertised on mount?"
+ _scratch_unmount
+}