From 0343db47f02e4de96c55111f5e19de86d2211eb3 Mon Sep 17 00:00:00 2001 From: Disha Goel Date: Thu, 18 Dec 2025 17:15:20 +0530 Subject: [PATCH 1/4] xfstests/ext4: re-enable ext4/048 for 64k block size The ext4/048 test was previously excluded from the 64k block size due to execution hangs. This issue has been resolved in the upstream xfstests suite via commit 1035b332 ("ext4/048: Fix hangup due to no free inodes"). This patch removes the exclusion to resume coverage for this test case. Signed-off-by: Disha Goel --- fs/xfstests.py.data/ext4/64k.yaml | 2 +- fs/xfstests.py.data/ext4/64k_adv.yaml | 2 +- fs/xfstests.py.data/ext4/64k_adv_auto.yaml | 2 +- fs/xfstests.py.data/ext4/64k_adv_upstream.yaml | 2 +- fs/xfstests.py.data/ext4/64k_auto.yaml | 2 +- fs/xfstests.py.data/ext4/64k_bigalloc.yaml | 2 +- fs/xfstests.py.data/ext4/64k_ext3.yaml | 2 +- fs/xfstests.py.data/ext4/64k_nodelalloc.yaml | 2 +- fs/xfstests.py.data/ext4/64k_nodioread_nolock.yaml | 2 +- fs/xfstests.py.data/ext4/64k_nojournal.yaml | 2 +- fs/xfstests.py.data/ext4/64k_upstream.yaml | 2 +- fs/xfstests.py.data/ext4/dax.yaml | 2 +- fs/xfstests.py.data/ext4/dax_log.yaml | 2 +- fs/xfstests.py.data/ext4/dax_upstream.yaml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/fs/xfstests.py.data/ext4/64k.yaml b/fs/xfstests.py.data/ext4/64k.yaml index 229d1f0f7..3d0b68988 100644 --- a/fs/xfstests.py.data/ext4/64k.yaml +++ b/fs/xfstests.py.data/ext4/64k.yaml @@ -12,6 +12,6 @@ loop_type: !mux fs_type: !mux fs_ext4_64k: fs: 'ext4' - args: '-R xunit -e ext4/048 -L 10 -g quick' + args: '-R xunit -L 10 -g quick' mkfs_opt: '-b 65536' mount_opt: '-o block_validity' diff --git a/fs/xfstests.py.data/ext4/64k_adv.yaml b/fs/xfstests.py.data/ext4/64k_adv.yaml index 91407359e..07ae4922b 100644 --- a/fs/xfstests.py.data/ext4/64k_adv.yaml +++ b/fs/xfstests.py.data/ext4/64k_adv.yaml @@ -12,6 +12,6 @@ loop_type: !mux fs_type: !mux fs_ext4_64k_adv: fs: 'ext4' - args: '-R xunit -e ext4/048 -L 10 -g quick' + args: '-R xunit -L 10 -g quick' mkfs_opt: '-b 65536 -O quota,inline_data,fast_commit' mount_opt: '-o block_validity' diff --git a/fs/xfstests.py.data/ext4/64k_adv_auto.yaml b/fs/xfstests.py.data/ext4/64k_adv_auto.yaml index d53206af6..2ef457803 100644 --- a/fs/xfstests.py.data/ext4/64k_adv_auto.yaml +++ b/fs/xfstests.py.data/ext4/64k_adv_auto.yaml @@ -12,6 +12,6 @@ loop_type: !mux fs_type: !mux fs_ext4_64k_adv_auto: fs: 'ext4' - args: '-R xunit -e ext4/048 -L 10 -g auto' + args: '-R xunit -L 10 -g auto' mkfs_opt: '-b 65536 -O quota,inline_data,fast_commit' mount_opt: '-o block_validity' diff --git a/fs/xfstests.py.data/ext4/64k_adv_upstream.yaml b/fs/xfstests.py.data/ext4/64k_adv_upstream.yaml index 4acf530e2..8a5da8724 100644 --- a/fs/xfstests.py.data/ext4/64k_adv_upstream.yaml +++ b/fs/xfstests.py.data/ext4/64k_adv_upstream.yaml @@ -12,7 +12,7 @@ loop_type: !mux fs_type: !mux fs_ext4_64k_adv: fs: 'ext4' - args: '-R xunit -e ext4/048 -L 10 -g quick' + args: '-R xunit -L 10 -g quick' mkfs_opt: '-b 65536 -O quota,inline_data,fast_commit' mount_opt: '-o block_validity' diff --git a/fs/xfstests.py.data/ext4/64k_auto.yaml b/fs/xfstests.py.data/ext4/64k_auto.yaml index 18043ad47..dfd913f86 100644 --- a/fs/xfstests.py.data/ext4/64k_auto.yaml +++ b/fs/xfstests.py.data/ext4/64k_auto.yaml @@ -12,6 +12,6 @@ loop_type: !mux fs_type: !mux fs_ext4_64k_auto: fs: 'ext4' - args: '-R xunit -e ext4/048 -L 10 -g auto' + args: '-R xunit -L 10 -g auto' mkfs_opt: '-b 65536' mount_opt: '-o block_validity' diff --git a/fs/xfstests.py.data/ext4/64k_bigalloc.yaml b/fs/xfstests.py.data/ext4/64k_bigalloc.yaml index dc1e5882c..29bef50f4 100644 --- a/fs/xfstests.py.data/ext4/64k_bigalloc.yaml +++ b/fs/xfstests.py.data/ext4/64k_bigalloc.yaml @@ -12,6 +12,6 @@ loop_type: !mux fs_type: !mux fs_ext4_64k_bigalloc: fs: 'ext4' - args: '-R xunit -e ext4/048 -L 10 -g quick' + args: '-R xunit -L 10 -g quick' mkfs_opt: '-b 65536 -O bigalloc' mount_opt: '-o block_validity' diff --git a/fs/xfstests.py.data/ext4/64k_ext3.yaml b/fs/xfstests.py.data/ext4/64k_ext3.yaml index f75a6459b..321ea7c41 100644 --- a/fs/xfstests.py.data/ext4/64k_ext3.yaml +++ b/fs/xfstests.py.data/ext4/64k_ext3.yaml @@ -12,6 +12,6 @@ loop_type: !mux fs_type: !mux fs_ext4_64k_ext3: fs: 'ext4' - args: '-R xunit -e ext4/048 -L 10 -g quick' + args: '-R xunit -L 10 -g quick' mkfs_opt: '-b 65536 -O ^extents,^flex_bg,^uninit_bg,^64bit,^metadata_csum,^huge_file,^dir_nlink,^extra_isize' mount_opt: '-o block_validity' diff --git a/fs/xfstests.py.data/ext4/64k_nodelalloc.yaml b/fs/xfstests.py.data/ext4/64k_nodelalloc.yaml index faa11c043..abce14a50 100644 --- a/fs/xfstests.py.data/ext4/64k_nodelalloc.yaml +++ b/fs/xfstests.py.data/ext4/64k_nodelalloc.yaml @@ -12,6 +12,6 @@ loop_type: !mux fs_type: !mux fs_ext4_64k_nodelalloc: fs: 'ext4' - args: '-R xunit -e ext4/048 -L 10 -g quick' + args: '-R xunit -L 10 -g quick' mkfs_opt: '-b 65536' mount_opt: '-o nodelalloc' diff --git a/fs/xfstests.py.data/ext4/64k_nodioread_nolock.yaml b/fs/xfstests.py.data/ext4/64k_nodioread_nolock.yaml index 368da3602..d7c2e5711 100644 --- a/fs/xfstests.py.data/ext4/64k_nodioread_nolock.yaml +++ b/fs/xfstests.py.data/ext4/64k_nodioread_nolock.yaml @@ -12,6 +12,6 @@ loop_type: !mux fs_type: !mux fs_ext4_64k_nodioread_nolock: fs: 'ext4' - args: '-R xunit -e ext4/048 -L 10 -g quick' + args: '-R xunit -L 10 -g quick' mkfs_opt: '-b 65536' mount_opt: '-o block_validity,nodioread_nolock' diff --git a/fs/xfstests.py.data/ext4/64k_nojournal.yaml b/fs/xfstests.py.data/ext4/64k_nojournal.yaml index 258dabaa4..dcfe7e817 100644 --- a/fs/xfstests.py.data/ext4/64k_nojournal.yaml +++ b/fs/xfstests.py.data/ext4/64k_nojournal.yaml @@ -12,6 +12,6 @@ loop_type: !mux fs_type: !mux fs_ext4_64k_nojournal: fs: 'ext4' - args: '-R xunit -e ext4/048 -L 10 -g quick' + args: '-R xunit -L 10 -g quick' mkfs_opt: '-b 65536 -O ^has_journal' mount_opt: '-o block_validity' diff --git a/fs/xfstests.py.data/ext4/64k_upstream.yaml b/fs/xfstests.py.data/ext4/64k_upstream.yaml index 527aa56ed..16b0aa4d0 100644 --- a/fs/xfstests.py.data/ext4/64k_upstream.yaml +++ b/fs/xfstests.py.data/ext4/64k_upstream.yaml @@ -12,7 +12,7 @@ loop_type: !mux fs_type: !mux fs_ext4_64k: fs: 'ext4' - args: '-R xunit -e ext4/048 -L 10 -g quick' + args: '-R xunit -L 10 -g quick' mkfs_opt: '-b 65536' mount_opt: '-o block_validity' diff --git a/fs/xfstests.py.data/ext4/dax.yaml b/fs/xfstests.py.data/ext4/dax.yaml index 14d1cc87d..edd9a1e6c 100644 --- a/fs/xfstests.py.data/ext4/dax.yaml +++ b/fs/xfstests.py.data/ext4/dax.yaml @@ -4,7 +4,7 @@ test_mnt: '/mnt/test_pmem' fs_type: !mux fs_ext4_dax: fs: 'ext4' - args: '-R xunit -e ext4/048 -L 10 -g auto' + args: '-R xunit -L 10 -g auto' mkfs_opt: '-b 65536' mount_opt: '-o block_validity,dax' diff --git a/fs/xfstests.py.data/ext4/dax_log.yaml b/fs/xfstests.py.data/ext4/dax_log.yaml index f2ece4a15..1ed70aa85 100644 --- a/fs/xfstests.py.data/ext4/dax_log.yaml +++ b/fs/xfstests.py.data/ext4/dax_log.yaml @@ -5,7 +5,7 @@ logdev: true fs_type: !mux fs_ext4: fs: 'ext4' - args: '-R xunit -e ext4/048 -L 10 -g quick' + args: '-R xunit -L 10 -g quick' mkfs_opt: '-b 65536' mount_opt: '-o block_validity,dax' diff --git a/fs/xfstests.py.data/ext4/dax_upstream.yaml b/fs/xfstests.py.data/ext4/dax_upstream.yaml index e7e3d3408..f1e065c9b 100644 --- a/fs/xfstests.py.data/ext4/dax_upstream.yaml +++ b/fs/xfstests.py.data/ext4/dax_upstream.yaml @@ -4,7 +4,7 @@ test_mnt: '/mnt/test_pmem' fs_type: !mux fs_ext4_dax: fs: 'ext4' - args: '-R xunit -e ext4/048 -L 10 -g quick' + args: '-R xunit -L 10 -g quick' mkfs_opt: '-b 65536' mount_opt: '-o block_validity,dax' From e52e35559186bb31f3ea88fc59ab6e977805e7a8 Mon Sep 17 00:00:00 2001 From: Disha Goel Date: Thu, 18 Dec 2025 17:22:24 +0530 Subject: [PATCH 2/4] fs/xfstests: Ensure unprivileged users can execute test binaries Several xfstests fail because the 'fsgqa' user cannot access or execute helper binaries (like fsstress or ftrunc) located in the root-owned working directory. Fails with error like: bash: line 1: ./src/: Permission denied open for write "file": Permission denied Fix this by recursively setting the xfstests directory permissions to readable and executable (a+rX). This allows unprivileged users for switching within tests without triggering "Permission denied" errors. Signed-off-by: Disha Goel --- fs/xfstests.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/xfstests.py b/fs/xfstests.py index 6ba89942e..cb40afe7d 100644 --- a/fs/xfstests.py +++ b/fs/xfstests.py @@ -23,6 +23,7 @@ import os import re import shutil +import subprocess from avocado import Test from avocado.utils import process, build, git, distro, partition from avocado.utils import disk, pmem, genio @@ -369,6 +370,8 @@ def setUp(self): git.get_repo('https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git', destination_dir=self.teststmpdir) build.make(self.teststmpdir, extra_args=f"-j{os.cpu_count()}") + os.chmod(self.workdir, 0o755) + subprocess.check_call(["chmod", "-R", "a+rX", self.teststmpdir]) # Ensure test users exist for user in ['fsgqa', 'fsgqa2', '123456-fsgqa']: From 8143d1d19151ca0ec45607484a6fb7f206514430 Mon Sep 17 00:00:00 2001 From: Disha Goel Date: Fri, 19 Dec 2025 12:18:52 +0530 Subject: [PATCH 3/4] fs/xfstests: Fix dependency resolution and config generation - Fix package installation for SLES < 16 by separating newer packages (like fsverity-utils-devel) into a version-specific block. - Restore missing dependencies (dbench, gdbm-devel) for supported distros. - Export MKFS_OPTIONS and MOUNT_OPTIONS in local.config so they are visible to xfstests scripts. - Ignore exit status for 'useradd' to prevent failures during 123456-fsgqa user creation on unsupported distro. Signed-off-by: Disha Goel --- fs/xfstests.py | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/fs/xfstests.py b/fs/xfstests.py index cb40afe7d..e0d724e1b 100644 --- a/fs/xfstests.py +++ b/fs/xfstests.py @@ -148,7 +148,7 @@ def __setUp_packages(self): dver = self.detected_distro.version packages = ['e2fsprogs', 'automake', 'gcc', 'quota', 'attr', 'make', - 'xfsprogs', 'gawk', 'git', 'sed', 'acl', 'bc', 'dbench', + 'xfsprogs', 'gawk', 'git', 'sed', 'acl', 'bc', 'dump', 'fio', 'xfsdump', 'indent', 'lvm2', 'psmisc'] if self.detected_distro.name in ['Ubuntu', 'debian']: packages.extend( @@ -157,7 +157,7 @@ def __setUp_packages(self): 'gettext', 'libinih-dev', 'liburcu-dev', 'libblkid-dev', 'liblzo2-dev', 'zlib1g-dev', 'e2fslibs-dev', 'libzstd-dev', 'libudev-dev', 'libcap-dev', 'liburing-dev', 'sqlite3', - f'linux-headers-{os.uname().release}', 'gettext']) + f'linux-headers-{os.uname().release}', 'dbench']) if self.detected_distro.version in ['14']: packages.append('libtool') else: @@ -172,8 +172,7 @@ def __setUp_packages(self): 'libtool', 'libacl-devel', 'libattr-devel', 'libaio-devel', 'libuuid-devel', 'libblkid-devel', 'lzo-devel', 'zlib-devel', 'e2fsprogs-devel', 'libzstd-devel', 'systemd-devel', 'meson', - 'xfsprogs-devel', 'gcc-c++', 'gdbm-devel', 'kernel-devel', - 'libcap-devel', 'liburing-devel', 'sqlite']) + 'xfsprogs-devel', 'gcc-c++', 'liburing-devel']) if self.detected_distro.name == 'rhel' and dver.startswith('9'): packages.append('inih-devel') @@ -182,20 +181,25 @@ def __setUp_packages(self): 'libbtrfs-devel', 'libcap-progs', 'liburcu-devel', 'libinih-devel', 'libopenssl-devel', 'gettext-tools', 'btrfsprogs', 'fsverity-utils', 'libfsverity0', - 'fsverity-utils-devel', 'duperemove', 'sqlite3', - 'checkbashisms', 'kernel-default-extra']) + 'duperemove', 'sqlite3']) if int(str(dver).split('.')[0]) < 16: packages.append('acct') + elif int(str(dver).split('.')[0]) >= 16: + packages.extend( + ['gdbm-devel', 'libcap-devel', 'fsverity-utils-devel', + 'kernel-default-extra']) else: - packages.extend(['userspace-rcu-devel', 'openssl-devel', 'gettext']) + packages.extend(['userspace-rcu-devel', 'openssl-devel', 'gettext', + 'gdbm-devel', 'kernel-devel', 'libcap-devel', + 'sqlite']) - packages_remove = ['indent', 'dbench', 'dump'] + packages_remove = ['indent', 'dump'] if 'rhel' in self.detected_distro.name and any(dver.startswith(x) for x in ['8', '9', '10']): packages = [p for p in packages if p not in packages_remove] if self.detected_distro.name in ['centos', 'fedora']: - packages.append('btrfs-progs-devel') + packages.extend(['btrfs-progs-devel', 'dbench']) else: self.cancel("test not supported in %s" % self.detected_distro.name) @@ -344,9 +348,9 @@ def setUp(self): new_lines.append(f'export SCRATCH_LOGDEV="{self.log_scratch}"\n') self.log_devices.append(self.log_scratch) if self.mkfs_opt: - new_lines.append(f'MKFS_OPTIONS="{self.mkfs_opt}"\n') + new_lines.append(f'export MKFS_OPTIONS="{self.mkfs_opt}"\n') if self.mount_opt: - new_lines.append(f'MOUNT_OPTIONS="{self.mount_opt}"\n') + new_lines.append(f'export MOUNT_OPTIONS="{self.mount_opt}"\n') with open(cfg_file, 'w') as f: f.writelines(new_lines) @@ -377,7 +381,7 @@ def setUp(self): for user in ['fsgqa', 'fsgqa2', '123456-fsgqa']: if process.system(f'id {user}', ignore_status=True): cmd = f'useradd -m {"-U " if user == "fsgqa" else ""}{user}' - process.system(cmd, sudo=True) + process.system(cmd, sudo=True, ignore_status=True) def _git_build(self, fs_type, repo_url, dirname, prefix, bin_prefix): # Generic helper to clone, configure and build a repo From 0ada3ea55c45fcb086352b066cbd1228a9439ced Mon Sep 17 00:00:00 2001 From: Disha Goel Date: Fri, 19 Dec 2025 12:21:35 +0530 Subject: [PATCH 4/4] fs/xfstests: explicitly enable io_uring before testing Enable io_uring when the kernel has the io_uring_disabled knob and it is disabled, allowing tests that rely on io_uring to run on systems where it is not enabled by default. Signed-off-by: Disha Goel --- fs/xfstests.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/fs/xfstests.py b/fs/xfstests.py index e0d724e1b..f8e9ebcf1 100644 --- a/fs/xfstests.py +++ b/fs/xfstests.py @@ -249,6 +249,19 @@ def setUp(self): self.__setUp_packages() + # Enable io_uring if disabled + knob = "/proc/sys/kernel/io_uring_disabled" + if os.path.exists(knob): + try: + current = int(process.system_output(f"cat {knob}").strip()) + # 0 = enabled, 1/2 = disabled + if current != 0: + process.run(f"echo 0 > {knob}", sudo=True, shell=True) + except Exception as ex: + self.log.warn(f"Could not update io_uring_disabled: {ex}") + else: + self.log.info("io_uring_disabled knob not present older kernel") + # Build upstream fs tools if requested if self.run_type == 'upstream': prefix = "/usr/local"