From 7028d60a643ac945826ae281ae5ec1940ee06fbf Mon Sep 17 00:00:00 2001 From: Jori Koolstra Date: Sun, 31 May 2026 12:49:46 +0200 Subject: vfs: missing inode operation should return a consistent error code Currently several different error codes are used in the VFS for situations where the underlying filesystem does not support the requested inode operation (such as mkdir, tmpfile, create, etc.) Examples: create returns EACCES, mkdir EPERM, tmpfile EOPNOTSUPP, fileattr_get ENOIOCTLCMD. We should provide a sensible unified error code for these situations. EOPNOTSUPP is already used for this both in the kernel (when lacking tmpfile support) and in userland (e.g. glibc).[1] Restricting EOPNOTSUPP to socket operations as POSIX suggests is not the current reality and this was recently changed in the man page as well.[2] vfs_fileattr_get|set return ENOIOCTLCMD, but this cannot be changed since EOPNOTSUPP is already used to by underlying filesystems to indicate that a flag is not supported. The change to EOPNOTSUPP was reverted by 4dd5b5ac089b ("Revert "fs: make vfs_fileattr_[get|set] return -EOPNOTSUPP"") [1]: https://lore.kernel.org/all/20260528-abnimmt-befreien-perspektive-a7930659fb40@brauner/ [2]: https://lore.kernel.org/linux-fsdevel/ahd3SmZZqnzP0-O2@devuan/T/#t Signed-off-by: Jori Koolstra Link: https://patch.msgid.link/20260531104947.6142-1-jkoolstra@xs4all.nl Signed-off-by: Christian Brauner (Amutable) --- include/uapi/asm-generic/errno.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/uapi') diff --git a/include/uapi/asm-generic/errno.h b/include/uapi/asm-generic/errno.h index bd78e69e0a43..c84ebf89c8b6 100644 --- a/include/uapi/asm-generic/errno.h +++ b/include/uapi/asm-generic/errno.h @@ -76,7 +76,7 @@ #define ENOPROTOOPT 92 /* Protocol not available */ #define EPROTONOSUPPORT 93 /* Protocol not supported */ #define ESOCKTNOSUPPORT 94 /* Socket type not supported */ -#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ +#define EOPNOTSUPP 95 /* Operation not supported */ #define EPFNOSUPPORT 96 /* Protocol family not supported */ #define EAFNOSUPPORT 97 /* Address family not supported by protocol */ #define EADDRINUSE 98 /* Address already in use */ -- cgit v1.2.3