Re: [PATCH] vfs: use UAPI types for new struct delegation definition
From: Thomas Weißschuh
Date: Thu Dec 04 2025 - 01:58:26 EST
On Wed, Dec 03, 2025 at 03:14:31PM +0100, Arnd Bergmann wrote:
> On Wed, Dec 3, 2025, at 14:57, Thomas Weißschuh wrote:
> > Using libc types and headers from the UAPI headers is problematic as it
> > introduces a dependency on a full C toolchain.
> >
> > Use the fixed-width integer types provided by the UAPI headers instead.
> >
> > Fixes: 1602bad16d7d ("vfs: expose delegation support to userland")
> > Fixes: 4be9e04ebf75 ("vfs: add needed headers for new struct delegation
> > definition")
> > Signed-off-by: Thomas Weißschuh <thomas.weissschuh@xxxxxxxxxxxxx>
>
> Acked-by: Arnd Bergmann <arnd@xxxxxxxx>
Thanks!
> > --- a/include/uapi/linux/fcntl.h
> > +++ b/include/uapi/linux/fcntl.h
> > @@ -4,11 +4,7 @@
> >
> > #include <asm/fcntl.h>
> > #include <linux/openat2.h>
> > -#ifdef __KERNEL__
> > #include <linux/types.h>
> > -#else
> > -#include <stdint.h>
> > -#endif
>
> I think we have a couple more files that could use similar changes,
> but they tend to be at a larger scale:
To start, let's extend the UAPI header tests to detect such dependencies [0].
Then we can clean them up without new ones popping up.
> include/uapi/linux/fuse.h
> include/uapi/linux/idxd.h
> include/uapi/linux/ax25.h
> include/uapi/regulator/regulator.h
> include/uapi/xen/privcmd.h
I have no idea how that header is supposed to work at all, as it depends on
non-UAPI headers. It is also ignored in the UAPI header tests.
[0] https://git.kernel.org/pub/scm/linux/kernel/git/thomas.weissschuh/linux.git/commit/?h=b4/uapi-nostdinc
Thomas