diff --git a/testcase/fio/fio.py b/testcase/fio/fio.py index 8c9599f54c2dffa8c466a3e8f1886b5ac4505d99..baa00f8924feeb46bb5a4bd83bd47f7d37ebfcc9 100644 --- a/testcase/fio/fio.py +++ b/testcase/fio/fio.py @@ -136,9 +136,26 @@ class PerfFio(TSTPerf): umount_blkdev(blkdev=block_dev) return block_dev elif fs == "xfs": - mount_point = self.format_mount_fs( - block_dev=block_dev, fs=fs, format_cmd="mkfs.xfs -f" - ) + # Disable features not supported by older kernels (e.g. 5.4.x): + # inobtcount - inode btree counters (kernel >= 5.16) + # bigtime - timestamps beyond 2038 (kernel >= 5.10) + # nrext64 - 64-bit extent counters (kernel >= 6.0) + # Passing these flags requires xfsprogs >= 5.10; if the installed + # xfsprogs is too old to recognise them the fallback retries with + # plain mkfs.xfs -f so older environments still work. + mkfs_xfs_compat = "mkfs.xfs -f -m inobtcount=0 -m bigtime=0 -i nrext64=0" + mkfs_xfs_plain = "mkfs.xfs -f" + try: + mount_point = self.format_mount_fs( + block_dev=block_dev, fs=fs, format_cmd=mkfs_xfs_compat + ) + except Exception: + self.log( + "mkfs.xfs with compat flags failed, retrying with plain mkfs.xfs -f" + ) + mount_point = self.format_mount_fs( + block_dev=block_dev, fs=fs, format_cmd=mkfs_xfs_plain + ) elif fs == "ext4": mount_point = self.format_mount_fs( block_dev=block_dev, fs=fs, format_cmd="mkfs.ext4 -F"