[LTP] [PATCH v2] syscalls: add file_attr05 test
Andrea Cervesato
andrea.cervesato@suse.com
Tue Jan 20 11:43:35 CET 2026
On Tue Jan 20, 2026 at 10:59 AM CET, Petr Vorel wrote:
> Hi all,
>
> > On Mon Jan 19, 2026 at 1:39 PM CET, Cyril Hrubis wrote:
> > > Hi!
> > > > + .filesystems = (struct tst_fs []) {
> > > > + {.type = "vfat"},
>
> > > I wonder if we can add more filesystems here, just to make sure that we
> > > run the test even when vfat is not compiled in the kernel. Does ext2
> > > implement the file_set/getattr calls?
>
> > > > + {}
> > > > + },
>
> > > Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
>
> > vfat and ntfs are the only ones which don't support both file_setattr()
> > and file_getattr(), while ext family, tmpfs and btrfs don't raise
> > EOPNOTSUPP for file_getattr() only.
>
> Interesting, I would expect vfat/ntfs would not support both. (I suppose exfat
> also does not support them).
>
> > I'm wondering if that's a bug, since
> > xfs is our reference for this implementation, or this has been
> > introduced in 6.18-rc2 by 7ea30958b3054f5e488fa0b33c352723f7ab3a2a
> > commit.
>
> Maybe ask Andrey Albershteyn (the author) and Christian Brauner (the committer)?
>
>
> > + * Regression test for "474b155adf39 - fs: make vfs_fileattr_[get|set] return
> > + * -EOPNOTSUPP".
>
> I also wonder if any of these should be mentioned in .tags (and in the text
> comment, which I find a bit redundant when we have .tags):
>
> 474b155adf392 ("fs: make vfs_fileattr_[get|set] return -EOPNOTSUPP") # v6.17
> NOTE: got reverted by 4dd5b5ac089bb in v6.18
>
> d90ad28e8aa48 ("fs: return EOPNOTSUPP from file_setattr/file_getattr syscalls") # v6.18
>
> Test itself LGTM.
> Reviewed-by: Petr Vorel <pvorel@suse.cz>
>
> Kind regards,
> Petr
I re-checked the code and it's a correct behaviour. The reason is that
every file_setattr() call using FSX feature will cause a EOPNOTSUPP for
filesystems not support it.
file_getattr() syscall is different, because it fetches data from a
filesystem without setting anything to it.
About vfat, `struct inode_operations` in the vfat implementation is not
defining .fileattr_get and .fileattr_set attributes, so we have a
reason for having a EOPNOTSUPP.
I think my approach is wrong, because the test is not really
verifying if FSX features are tested or not, but verifying that vfat is
not implementing file_setattr/file_getattr. Hence I will change this
test, verifying file_setattr() syscall only, including all filesystems
and checking that XFS features are triggering EOPNOTSUPP, except for
XFS.
I will send a v3.
Thanks,
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com
More information about the ltp
mailing list