[LTP] [PATCH v2] syscalls/file_attr01: Dynamically expect EOPNOTSUPP on tmpfs without xattr
Cyril Hrubis
chrubis@suse.cz
Thu Apr 16 15:49:58 CEST 2026
Hi!
> @@ -115,20 +116,28 @@ static struct tcase {
> static void run(unsigned int i)
> {
> struct tcase *tc = &tcases[i];
> + int exp_errno = tc->exp_errno;
> +
> + if (tc->ufattr == (struct file_attr **)(&null_ptr)) {
> + const char *const kconfig[] = {"CONFIG_TMPFS_XATTR=y", NULL};
> +
> + if (!strcmp(tst_device->fs_type, "tmpfs") && tst_kconfig_check(kconfig))
> + exp_errno = EOPNOTSUPP;
> + }
The call to tst_kconfig_check() should be done once in the test setup()
and we should set a flag based on the outcome. Without that we will
parse the kernel config in each iteration of the run() function (e.g. if
run the test with -i 10).
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list