[LTP] [PATCH] syscalls/file_attr01: Allow EOPNOTSUPP when attributes is NULL
Andrea Cervesato
andrea.cervesato@suse.com
Fri Mar 20 09:57:39 CET 2026
Hi Wake,
> The syscalls file_getattr and file_setattr may return EOPNOTSUPP
> instead of EFAULT when the ufattr argument is NULL, specifically on
> filesystems that do not support extended attributes (e.g., tmpfs when
> CONFIG_TMPFS_XATTR is disabled).
Patch is technically correct but EOPNOTSUPP should not be tested int this way,
since we are not checking the underlying kernel configuration. For instance,
we might have xattr support, but getting EOPNOTSUPP and have a TPASS. This
would be a kernel bug hidden by the test structure.
In other circumstances (if xattr was our testing goal) we might have used
.needs_kconfig, but in this case we should use a different approach:
- we verify at runtime that our kernel supports xattr via tst_kconfig_check()
- if kernel doesn't support xattr, we expect EOPNOTSUPP. Otherwise, EFAULT
In this way we make sure that syscalls are raising the proper error according
to the kernel configuration.
WDYT?
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com
More information about the ltp
mailing list