* [PATCHSET V4 1/2] fs: generic file IO error reporting
@ 2025-12-18 2:02 Darrick J. Wong
2025-12-18 2:02 ` [PATCH 1/6] uapi: promote EFSCORRUPTED and EUCLEAN to errno.h Darrick J. Wong
0 siblings, 1 reply; 7+ messages in thread
From: Darrick J. Wong @ 2025-12-18 2:02 UTC (permalink / raw)
To: brauner, djwong
Cc: linux-api, hch, linux-ext4, jack, linux-xfs, linux-fsdevel,
gabriel, hch, amir73il
Hi all,
This patchset adds some generic helpers so that filesystems can report
errors to fsnotify in a standard way. Then it adapts iomap to use the
generic helpers so that any iomap-enabled filesystem can report I/O
errors through this mechanism as well. Finally, it makes XFS report
metadata errors through this mechanism in much the same way that ext4
does now.
These are a prerequisite for the XFS self-healing V4 series which will
come at a later time.
If you're going to start using this code, I strongly recommend pulling
from my git trees, which are linked below.
This has been running on the djcloud for months with no problems. Enjoy!
Comments and questions are, as always, welcome.
--D
kernel git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=filesystem-error-reporting
fstests git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfstests-dev.git/log/?h=filesystem-error-reporting
---
Commits in this patchset:
* uapi: promote EFSCORRUPTED and EUCLEAN to errno.h
* fs: report filesystem and file I/O errors to fsnotify
* iomap: report file I/O errors to the VFS
* xfs: report fs metadata errors via fsnotify
* xfs: translate fsdax media errors into file "data lost" errors when convenient
* ext4: convert to new fserror helpers
---
arch/alpha/include/uapi/asm/errno.h | 2
arch/mips/include/uapi/asm/errno.h | 2
arch/parisc/include/uapi/asm/errno.h | 2
arch/sparc/include/uapi/asm/errno.h | 2
fs/erofs/internal.h | 2
fs/ext2/ext2.h | 1
fs/ext4/ext4.h | 3 -
fs/f2fs/f2fs.h | 3 -
fs/minix/minix.h | 2
fs/udf/udf_sb.h | 2
fs/xfs/xfs_linux.h | 2
include/linux/fs/super_types.h | 7 +
include/linux/fserror.h | 93 ++++++++++++++++
include/linux/jbd2.h | 3 -
include/uapi/asm-generic/errno.h | 2
tools/arch/alpha/include/uapi/asm/errno.h | 2
tools/arch/mips/include/uapi/asm/errno.h | 2
tools/arch/parisc/include/uapi/asm/errno.h | 2
tools/arch/sparc/include/uapi/asm/errno.h | 2
tools/include/uapi/asm-generic/errno.h | 2
fs/Makefile | 2
fs/ext4/ioctl.c | 2
fs/ext4/super.c | 13 ++
fs/fserror.c | 168 ++++++++++++++++++++++++++++
fs/iomap/buffered-io.c | 23 ++++
fs/iomap/direct-io.c | 12 ++
fs/iomap/ioend.c | 6 +
fs/super.c | 3 +
fs/xfs/xfs_fsops.c | 4 +
fs/xfs/xfs_health.c | 14 ++
fs/xfs/xfs_notify_failure.c | 4 +
31 files changed, 365 insertions(+), 24 deletions(-)
create mode 100644 include/linux/fserror.h
create mode 100644 fs/fserror.c
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/6] uapi: promote EFSCORRUPTED and EUCLEAN to errno.h
2025-12-18 2:02 [PATCHSET V4 1/2] fs: generic file IO error reporting Darrick J. Wong
@ 2025-12-18 2:02 ` Darrick J. Wong
2025-12-18 5:17 ` Christoph Hellwig
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Darrick J. Wong @ 2025-12-18 2:02 UTC (permalink / raw)
To: brauner, djwong
Cc: linux-api, linux-ext4, jack, linux-xfs, linux-fsdevel, gabriel,
hch, amir73il
From: Darrick J. Wong <djwong@kernel.org>
Stop definining these privately and instead move them to the uapi
errno.h so that they become canonical instead of copy pasta.
Cc: linux-api@vger.kernel.org
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
---
arch/alpha/include/uapi/asm/errno.h | 2 ++
arch/mips/include/uapi/asm/errno.h | 2 ++
arch/parisc/include/uapi/asm/errno.h | 2 ++
arch/sparc/include/uapi/asm/errno.h | 2 ++
fs/erofs/internal.h | 2 --
fs/ext2/ext2.h | 1 -
fs/ext4/ext4.h | 3 ---
fs/f2fs/f2fs.h | 3 ---
fs/minix/minix.h | 2 --
fs/udf/udf_sb.h | 2 --
fs/xfs/xfs_linux.h | 2 --
include/linux/jbd2.h | 3 ---
include/uapi/asm-generic/errno.h | 2 ++
tools/arch/alpha/include/uapi/asm/errno.h | 2 ++
tools/arch/mips/include/uapi/asm/errno.h | 2 ++
tools/arch/parisc/include/uapi/asm/errno.h | 2 ++
tools/arch/sparc/include/uapi/asm/errno.h | 2 ++
tools/include/uapi/asm-generic/errno.h | 2 ++
18 files changed, 20 insertions(+), 18 deletions(-)
diff --git a/arch/alpha/include/uapi/asm/errno.h b/arch/alpha/include/uapi/asm/errno.h
index 3d265f6babaf0a..6791f6508632ee 100644
--- a/arch/alpha/include/uapi/asm/errno.h
+++ b/arch/alpha/include/uapi/asm/errno.h
@@ -55,6 +55,7 @@
#define ENOSR 82 /* Out of streams resources */
#define ETIME 83 /* Timer expired */
#define EBADMSG 84 /* Not a data message */
+#define EFSBADCRC EBADMSG /* Bad CRC detected */
#define EPROTO 85 /* Protocol error */
#define ENODATA 86 /* No data available */
#define ENOSTR 87 /* Device not a stream */
@@ -96,6 +97,7 @@
#define EREMCHG 115 /* Remote address changed */
#define EUCLEAN 117 /* Structure needs cleaning */
+#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
#define ENOTNAM 118 /* Not a XENIX named type file */
#define ENAVAIL 119 /* No XENIX semaphores available */
#define EISNAM 120 /* Is a named type file */
diff --git a/arch/mips/include/uapi/asm/errno.h b/arch/mips/include/uapi/asm/errno.h
index 2fb714e2d6d8fc..c01ed91b1ef44b 100644
--- a/arch/mips/include/uapi/asm/errno.h
+++ b/arch/mips/include/uapi/asm/errno.h
@@ -50,6 +50,7 @@
#define EDOTDOT 73 /* RFS specific error */
#define EMULTIHOP 74 /* Multihop attempted */
#define EBADMSG 77 /* Not a data message */
+#define EFSBADCRC EBADMSG /* Bad CRC detected */
#define ENAMETOOLONG 78 /* File name too long */
#define EOVERFLOW 79 /* Value too large for defined data type */
#define ENOTUNIQ 80 /* Name not unique on network */
@@ -88,6 +89,7 @@
#define EISCONN 133 /* Transport endpoint is already connected */
#define ENOTCONN 134 /* Transport endpoint is not connected */
#define EUCLEAN 135 /* Structure needs cleaning */
+#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
#define ENOTNAM 137 /* Not a XENIX named type file */
#define ENAVAIL 138 /* No XENIX semaphores available */
#define EISNAM 139 /* Is a named type file */
diff --git a/arch/parisc/include/uapi/asm/errno.h b/arch/parisc/include/uapi/asm/errno.h
index 8d94739d75c67c..8cbc07c1903e4c 100644
--- a/arch/parisc/include/uapi/asm/errno.h
+++ b/arch/parisc/include/uapi/asm/errno.h
@@ -36,6 +36,7 @@
#define EDOTDOT 66 /* RFS specific error */
#define EBADMSG 67 /* Not a data message */
+#define EFSBADCRC EBADMSG /* Bad CRC detected */
#define EUSERS 68 /* Too many users */
#define EDQUOT 69 /* Quota exceeded */
#define ESTALE 70 /* Stale file handle */
@@ -62,6 +63,7 @@
#define ERESTART 175 /* Interrupted system call should be restarted */
#define ESTRPIPE 176 /* Streams pipe error */
#define EUCLEAN 177 /* Structure needs cleaning */
+#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
#define ENOTNAM 178 /* Not a XENIX named type file */
#define ENAVAIL 179 /* No XENIX semaphores available */
#define EISNAM 180 /* Is a named type file */
diff --git a/arch/sparc/include/uapi/asm/errno.h b/arch/sparc/include/uapi/asm/errno.h
index 81a732b902ee38..4a41e7835fd5b8 100644
--- a/arch/sparc/include/uapi/asm/errno.h
+++ b/arch/sparc/include/uapi/asm/errno.h
@@ -48,6 +48,7 @@
#define ENOSR 74 /* Out of streams resources */
#define ENOMSG 75 /* No message of desired type */
#define EBADMSG 76 /* Not a data message */
+#define EFSBADCRC EBADMSG /* Bad CRC detected */
#define EIDRM 77 /* Identifier removed */
#define EDEADLK 78 /* Resource deadlock would occur */
#define ENOLCK 79 /* No record locks available */
@@ -91,6 +92,7 @@
#define ENOTUNIQ 115 /* Name not unique on network */
#define ERESTART 116 /* Interrupted syscall should be restarted */
#define EUCLEAN 117 /* Structure needs cleaning */
+#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
#define ENOTNAM 118 /* Not a XENIX named type file */
#define ENAVAIL 119 /* No XENIX semaphores available */
#define EISNAM 120 /* Is a named type file */
diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h
index f7f622836198da..d06e99baf5d5ae 100644
--- a/fs/erofs/internal.h
+++ b/fs/erofs/internal.h
@@ -541,6 +541,4 @@ long erofs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
long erofs_compat_ioctl(struct file *filp, unsigned int cmd,
unsigned long arg);
-#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
-
#endif /* __EROFS_INTERNAL_H */
diff --git a/fs/ext2/ext2.h b/fs/ext2/ext2.h
index cf97b76e9fd3e9..5e0c6c5fcb6cd6 100644
--- a/fs/ext2/ext2.h
+++ b/fs/ext2/ext2.h
@@ -357,7 +357,6 @@ struct ext2_inode {
*/
#define EXT2_VALID_FS 0x0001 /* Unmounted cleanly */
#define EXT2_ERROR_FS 0x0002 /* Errors detected */
-#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
/*
* Mount flags
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 56112f201cace7..62c091b52bacdf 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -3938,7 +3938,4 @@ extern int ext4_block_write_begin(handle_t *handle, struct folio *folio,
get_block_t *get_block);
#endif /* __KERNEL__ */
-#define EFSBADCRC EBADMSG /* Bad CRC detected */
-#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
-
#endif /* _EXT4_H */
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 20edbb99b814a7..9f3aa3c7f12613 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -5004,7 +5004,4 @@ static inline void f2fs_invalidate_internal_cache(struct f2fs_sb_info *sbi,
f2fs_invalidate_compress_pages_range(sbi, blkaddr, len);
}
-#define EFSBADCRC EBADMSG /* Bad CRC detected */
-#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
-
#endif /* _LINUX_F2FS_H */
diff --git a/fs/minix/minix.h b/fs/minix/minix.h
index 2bfaf377f2086c..7e1f652f16d311 100644
--- a/fs/minix/minix.h
+++ b/fs/minix/minix.h
@@ -175,6 +175,4 @@ static inline int minix_test_bit(int nr, const void *vaddr)
__minix_error_inode((inode), __func__, __LINE__, \
(fmt), ##__VA_ARGS__)
-#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
-
#endif /* FS_MINIX_H */
diff --git a/fs/udf/udf_sb.h b/fs/udf/udf_sb.h
index 08ec8756b9487b..8399accc788dea 100644
--- a/fs/udf/udf_sb.h
+++ b/fs/udf/udf_sb.h
@@ -55,8 +55,6 @@
#define MF_DUPLICATE_MD 0x01
#define MF_MIRROR_FE_LOADED 0x02
-#define EFSCORRUPTED EUCLEAN
-
struct udf_meta_data {
__u32 s_meta_file_loc;
__u32 s_mirror_file_loc;
diff --git a/fs/xfs/xfs_linux.h b/fs/xfs/xfs_linux.h
index 4dd747bdbccab2..55064228c4d574 100644
--- a/fs/xfs/xfs_linux.h
+++ b/fs/xfs/xfs_linux.h
@@ -121,8 +121,6 @@ typedef __u32 xfs_nlink_t;
#define ENOATTR ENODATA /* Attribute not found */
#define EWRONGFS EINVAL /* Mount with wrong filesystem type */
-#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
-#define EFSBADCRC EBADMSG /* Bad CRC detected */
#define __return_address __builtin_return_address(0)
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index f5eaf76198f377..a53a00d36228ce 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -1815,7 +1815,4 @@ static inline int jbd2_handle_buffer_credits(handle_t *handle)
#endif /* __KERNEL__ */
-#define EFSBADCRC EBADMSG /* Bad CRC detected */
-#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
-
#endif /* _LINUX_JBD2_H */
diff --git a/include/uapi/asm-generic/errno.h b/include/uapi/asm-generic/errno.h
index cf9c51ac49f97e..92e7ae493ee315 100644
--- a/include/uapi/asm-generic/errno.h
+++ b/include/uapi/asm-generic/errno.h
@@ -55,6 +55,7 @@
#define EMULTIHOP 72 /* Multihop attempted */
#define EDOTDOT 73 /* RFS specific error */
#define EBADMSG 74 /* Not a data message */
+#define EFSBADCRC EBADMSG /* Bad CRC detected */
#define EOVERFLOW 75 /* Value too large for defined data type */
#define ENOTUNIQ 76 /* Name not unique on network */
#define EBADFD 77 /* File descriptor in bad state */
@@ -98,6 +99,7 @@
#define EINPROGRESS 115 /* Operation now in progress */
#define ESTALE 116 /* Stale file handle */
#define EUCLEAN 117 /* Structure needs cleaning */
+#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
#define ENOTNAM 118 /* Not a XENIX named type file */
#define ENAVAIL 119 /* No XENIX semaphores available */
#define EISNAM 120 /* Is a named type file */
diff --git a/tools/arch/alpha/include/uapi/asm/errno.h b/tools/arch/alpha/include/uapi/asm/errno.h
index 3d265f6babaf0a..6791f6508632ee 100644
--- a/tools/arch/alpha/include/uapi/asm/errno.h
+++ b/tools/arch/alpha/include/uapi/asm/errno.h
@@ -55,6 +55,7 @@
#define ENOSR 82 /* Out of streams resources */
#define ETIME 83 /* Timer expired */
#define EBADMSG 84 /* Not a data message */
+#define EFSBADCRC EBADMSG /* Bad CRC detected */
#define EPROTO 85 /* Protocol error */
#define ENODATA 86 /* No data available */
#define ENOSTR 87 /* Device not a stream */
@@ -96,6 +97,7 @@
#define EREMCHG 115 /* Remote address changed */
#define EUCLEAN 117 /* Structure needs cleaning */
+#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
#define ENOTNAM 118 /* Not a XENIX named type file */
#define ENAVAIL 119 /* No XENIX semaphores available */
#define EISNAM 120 /* Is a named type file */
diff --git a/tools/arch/mips/include/uapi/asm/errno.h b/tools/arch/mips/include/uapi/asm/errno.h
index 2fb714e2d6d8fc..c01ed91b1ef44b 100644
--- a/tools/arch/mips/include/uapi/asm/errno.h
+++ b/tools/arch/mips/include/uapi/asm/errno.h
@@ -50,6 +50,7 @@
#define EDOTDOT 73 /* RFS specific error */
#define EMULTIHOP 74 /* Multihop attempted */
#define EBADMSG 77 /* Not a data message */
+#define EFSBADCRC EBADMSG /* Bad CRC detected */
#define ENAMETOOLONG 78 /* File name too long */
#define EOVERFLOW 79 /* Value too large for defined data type */
#define ENOTUNIQ 80 /* Name not unique on network */
@@ -88,6 +89,7 @@
#define EISCONN 133 /* Transport endpoint is already connected */
#define ENOTCONN 134 /* Transport endpoint is not connected */
#define EUCLEAN 135 /* Structure needs cleaning */
+#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
#define ENOTNAM 137 /* Not a XENIX named type file */
#define ENAVAIL 138 /* No XENIX semaphores available */
#define EISNAM 139 /* Is a named type file */
diff --git a/tools/arch/parisc/include/uapi/asm/errno.h b/tools/arch/parisc/include/uapi/asm/errno.h
index 8d94739d75c67c..8cbc07c1903e4c 100644
--- a/tools/arch/parisc/include/uapi/asm/errno.h
+++ b/tools/arch/parisc/include/uapi/asm/errno.h
@@ -36,6 +36,7 @@
#define EDOTDOT 66 /* RFS specific error */
#define EBADMSG 67 /* Not a data message */
+#define EFSBADCRC EBADMSG /* Bad CRC detected */
#define EUSERS 68 /* Too many users */
#define EDQUOT 69 /* Quota exceeded */
#define ESTALE 70 /* Stale file handle */
@@ -62,6 +63,7 @@
#define ERESTART 175 /* Interrupted system call should be restarted */
#define ESTRPIPE 176 /* Streams pipe error */
#define EUCLEAN 177 /* Structure needs cleaning */
+#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
#define ENOTNAM 178 /* Not a XENIX named type file */
#define ENAVAIL 179 /* No XENIX semaphores available */
#define EISNAM 180 /* Is a named type file */
diff --git a/tools/arch/sparc/include/uapi/asm/errno.h b/tools/arch/sparc/include/uapi/asm/errno.h
index 81a732b902ee38..4a41e7835fd5b8 100644
--- a/tools/arch/sparc/include/uapi/asm/errno.h
+++ b/tools/arch/sparc/include/uapi/asm/errno.h
@@ -48,6 +48,7 @@
#define ENOSR 74 /* Out of streams resources */
#define ENOMSG 75 /* No message of desired type */
#define EBADMSG 76 /* Not a data message */
+#define EFSBADCRC EBADMSG /* Bad CRC detected */
#define EIDRM 77 /* Identifier removed */
#define EDEADLK 78 /* Resource deadlock would occur */
#define ENOLCK 79 /* No record locks available */
@@ -91,6 +92,7 @@
#define ENOTUNIQ 115 /* Name not unique on network */
#define ERESTART 116 /* Interrupted syscall should be restarted */
#define EUCLEAN 117 /* Structure needs cleaning */
+#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
#define ENOTNAM 118 /* Not a XENIX named type file */
#define ENAVAIL 119 /* No XENIX semaphores available */
#define EISNAM 120 /* Is a named type file */
diff --git a/tools/include/uapi/asm-generic/errno.h b/tools/include/uapi/asm-generic/errno.h
index cf9c51ac49f97e..92e7ae493ee315 100644
--- a/tools/include/uapi/asm-generic/errno.h
+++ b/tools/include/uapi/asm-generic/errno.h
@@ -55,6 +55,7 @@
#define EMULTIHOP 72 /* Multihop attempted */
#define EDOTDOT 73 /* RFS specific error */
#define EBADMSG 74 /* Not a data message */
+#define EFSBADCRC EBADMSG /* Bad CRC detected */
#define EOVERFLOW 75 /* Value too large for defined data type */
#define ENOTUNIQ 76 /* Name not unique on network */
#define EBADFD 77 /* File descriptor in bad state */
@@ -98,6 +99,7 @@
#define EINPROGRESS 115 /* Operation now in progress */
#define ESTALE 116 /* Stale file handle */
#define EUCLEAN 117 /* Structure needs cleaning */
+#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
#define ENOTNAM 118 /* Not a XENIX named type file */
#define ENAVAIL 119 /* No XENIX semaphores available */
#define EISNAM 120 /* Is a named type file */
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/6] uapi: promote EFSCORRUPTED and EUCLEAN to errno.h
2025-12-18 2:02 ` [PATCH 1/6] uapi: promote EFSCORRUPTED and EUCLEAN to errno.h Darrick J. Wong
@ 2025-12-18 5:17 ` Christoph Hellwig
2025-12-18 11:04 ` Alejandro Colomar
2025-12-18 9:33 ` Gao Xiang
2025-12-22 15:01 ` Jan Kara
2 siblings, 1 reply; 7+ messages in thread
From: Christoph Hellwig @ 2025-12-18 5:17 UTC (permalink / raw)
To: Darrick J. Wong
Cc: brauner, linux-api, linux-ext4, jack, linux-xfs, linux-fsdevel,
gabriel, amir73il, linux-man
On Wed, Dec 17, 2025 at 06:02:56PM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
>
> Stop definining these privately and instead move them to the uapi
> errno.h so that they become canonical instead of copy pasta.
Sounds fine:
Reviewed-by: Christoph Hellwig <hch@lst.de>
Do we need to document these overlay errnos in the man man pages,
though?
>
> Cc: linux-api@vger.kernel.org
> Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
> ---
> arch/alpha/include/uapi/asm/errno.h | 2 ++
> arch/mips/include/uapi/asm/errno.h | 2 ++
> arch/parisc/include/uapi/asm/errno.h | 2 ++
> arch/sparc/include/uapi/asm/errno.h | 2 ++
> fs/erofs/internal.h | 2 --
> fs/ext2/ext2.h | 1 -
> fs/ext4/ext4.h | 3 ---
> fs/f2fs/f2fs.h | 3 ---
> fs/minix/minix.h | 2 --
> fs/udf/udf_sb.h | 2 --
> fs/xfs/xfs_linux.h | 2 --
> include/linux/jbd2.h | 3 ---
> include/uapi/asm-generic/errno.h | 2 ++
> tools/arch/alpha/include/uapi/asm/errno.h | 2 ++
> tools/arch/mips/include/uapi/asm/errno.h | 2 ++
> tools/arch/parisc/include/uapi/asm/errno.h | 2 ++
> tools/arch/sparc/include/uapi/asm/errno.h | 2 ++
> tools/include/uapi/asm-generic/errno.h | 2 ++
> 18 files changed, 20 insertions(+), 18 deletions(-)
>
>
> diff --git a/arch/alpha/include/uapi/asm/errno.h b/arch/alpha/include/uapi/asm/errno.h
> index 3d265f6babaf0a..6791f6508632ee 100644
> --- a/arch/alpha/include/uapi/asm/errno.h
> +++ b/arch/alpha/include/uapi/asm/errno.h
> @@ -55,6 +55,7 @@
> #define ENOSR 82 /* Out of streams resources */
> #define ETIME 83 /* Timer expired */
> #define EBADMSG 84 /* Not a data message */
> +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> #define EPROTO 85 /* Protocol error */
> #define ENODATA 86 /* No data available */
> #define ENOSTR 87 /* Device not a stream */
> @@ -96,6 +97,7 @@
> #define EREMCHG 115 /* Remote address changed */
>
> #define EUCLEAN 117 /* Structure needs cleaning */
> +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> #define ENOTNAM 118 /* Not a XENIX named type file */
> #define ENAVAIL 119 /* No XENIX semaphores available */
> #define EISNAM 120 /* Is a named type file */
> diff --git a/arch/mips/include/uapi/asm/errno.h b/arch/mips/include/uapi/asm/errno.h
> index 2fb714e2d6d8fc..c01ed91b1ef44b 100644
> --- a/arch/mips/include/uapi/asm/errno.h
> +++ b/arch/mips/include/uapi/asm/errno.h
> @@ -50,6 +50,7 @@
> #define EDOTDOT 73 /* RFS specific error */
> #define EMULTIHOP 74 /* Multihop attempted */
> #define EBADMSG 77 /* Not a data message */
> +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> #define ENAMETOOLONG 78 /* File name too long */
> #define EOVERFLOW 79 /* Value too large for defined data type */
> #define ENOTUNIQ 80 /* Name not unique on network */
> @@ -88,6 +89,7 @@
> #define EISCONN 133 /* Transport endpoint is already connected */
> #define ENOTCONN 134 /* Transport endpoint is not connected */
> #define EUCLEAN 135 /* Structure needs cleaning */
> +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> #define ENOTNAM 137 /* Not a XENIX named type file */
> #define ENAVAIL 138 /* No XENIX semaphores available */
> #define EISNAM 139 /* Is a named type file */
> diff --git a/arch/parisc/include/uapi/asm/errno.h b/arch/parisc/include/uapi/asm/errno.h
> index 8d94739d75c67c..8cbc07c1903e4c 100644
> --- a/arch/parisc/include/uapi/asm/errno.h
> +++ b/arch/parisc/include/uapi/asm/errno.h
> @@ -36,6 +36,7 @@
>
> #define EDOTDOT 66 /* RFS specific error */
> #define EBADMSG 67 /* Not a data message */
> +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> #define EUSERS 68 /* Too many users */
> #define EDQUOT 69 /* Quota exceeded */
> #define ESTALE 70 /* Stale file handle */
> @@ -62,6 +63,7 @@
> #define ERESTART 175 /* Interrupted system call should be restarted */
> #define ESTRPIPE 176 /* Streams pipe error */
> #define EUCLEAN 177 /* Structure needs cleaning */
> +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> #define ENOTNAM 178 /* Not a XENIX named type file */
> #define ENAVAIL 179 /* No XENIX semaphores available */
> #define EISNAM 180 /* Is a named type file */
> diff --git a/arch/sparc/include/uapi/asm/errno.h b/arch/sparc/include/uapi/asm/errno.h
> index 81a732b902ee38..4a41e7835fd5b8 100644
> --- a/arch/sparc/include/uapi/asm/errno.h
> +++ b/arch/sparc/include/uapi/asm/errno.h
> @@ -48,6 +48,7 @@
> #define ENOSR 74 /* Out of streams resources */
> #define ENOMSG 75 /* No message of desired type */
> #define EBADMSG 76 /* Not a data message */
> +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> #define EIDRM 77 /* Identifier removed */
> #define EDEADLK 78 /* Resource deadlock would occur */
> #define ENOLCK 79 /* No record locks available */
> @@ -91,6 +92,7 @@
> #define ENOTUNIQ 115 /* Name not unique on network */
> #define ERESTART 116 /* Interrupted syscall should be restarted */
> #define EUCLEAN 117 /* Structure needs cleaning */
> +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> #define ENOTNAM 118 /* Not a XENIX named type file */
> #define ENAVAIL 119 /* No XENIX semaphores available */
> #define EISNAM 120 /* Is a named type file */
> diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h
> index f7f622836198da..d06e99baf5d5ae 100644
> --- a/fs/erofs/internal.h
> +++ b/fs/erofs/internal.h
> @@ -541,6 +541,4 @@ long erofs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
> long erofs_compat_ioctl(struct file *filp, unsigned int cmd,
> unsigned long arg);
>
> -#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> -
> #endif /* __EROFS_INTERNAL_H */
> diff --git a/fs/ext2/ext2.h b/fs/ext2/ext2.h
> index cf97b76e9fd3e9..5e0c6c5fcb6cd6 100644
> --- a/fs/ext2/ext2.h
> +++ b/fs/ext2/ext2.h
> @@ -357,7 +357,6 @@ struct ext2_inode {
> */
> #define EXT2_VALID_FS 0x0001 /* Unmounted cleanly */
> #define EXT2_ERROR_FS 0x0002 /* Errors detected */
> -#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
>
> /*
> * Mount flags
> diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
> index 56112f201cace7..62c091b52bacdf 100644
> --- a/fs/ext4/ext4.h
> +++ b/fs/ext4/ext4.h
> @@ -3938,7 +3938,4 @@ extern int ext4_block_write_begin(handle_t *handle, struct folio *folio,
> get_block_t *get_block);
> #endif /* __KERNEL__ */
>
> -#define EFSBADCRC EBADMSG /* Bad CRC detected */
> -#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> -
> #endif /* _EXT4_H */
> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> index 20edbb99b814a7..9f3aa3c7f12613 100644
> --- a/fs/f2fs/f2fs.h
> +++ b/fs/f2fs/f2fs.h
> @@ -5004,7 +5004,4 @@ static inline void f2fs_invalidate_internal_cache(struct f2fs_sb_info *sbi,
> f2fs_invalidate_compress_pages_range(sbi, blkaddr, len);
> }
>
> -#define EFSBADCRC EBADMSG /* Bad CRC detected */
> -#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> -
> #endif /* _LINUX_F2FS_H */
> diff --git a/fs/minix/minix.h b/fs/minix/minix.h
> index 2bfaf377f2086c..7e1f652f16d311 100644
> --- a/fs/minix/minix.h
> +++ b/fs/minix/minix.h
> @@ -175,6 +175,4 @@ static inline int minix_test_bit(int nr, const void *vaddr)
> __minix_error_inode((inode), __func__, __LINE__, \
> (fmt), ##__VA_ARGS__)
>
> -#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> -
> #endif /* FS_MINIX_H */
> diff --git a/fs/udf/udf_sb.h b/fs/udf/udf_sb.h
> index 08ec8756b9487b..8399accc788dea 100644
> --- a/fs/udf/udf_sb.h
> +++ b/fs/udf/udf_sb.h
> @@ -55,8 +55,6 @@
> #define MF_DUPLICATE_MD 0x01
> #define MF_MIRROR_FE_LOADED 0x02
>
> -#define EFSCORRUPTED EUCLEAN
> -
> struct udf_meta_data {
> __u32 s_meta_file_loc;
> __u32 s_mirror_file_loc;
> diff --git a/fs/xfs/xfs_linux.h b/fs/xfs/xfs_linux.h
> index 4dd747bdbccab2..55064228c4d574 100644
> --- a/fs/xfs/xfs_linux.h
> +++ b/fs/xfs/xfs_linux.h
> @@ -121,8 +121,6 @@ typedef __u32 xfs_nlink_t;
>
> #define ENOATTR ENODATA /* Attribute not found */
> #define EWRONGFS EINVAL /* Mount with wrong filesystem type */
> -#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> -#define EFSBADCRC EBADMSG /* Bad CRC detected */
>
> #define __return_address __builtin_return_address(0)
>
> diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
> index f5eaf76198f377..a53a00d36228ce 100644
> --- a/include/linux/jbd2.h
> +++ b/include/linux/jbd2.h
> @@ -1815,7 +1815,4 @@ static inline int jbd2_handle_buffer_credits(handle_t *handle)
>
> #endif /* __KERNEL__ */
>
> -#define EFSBADCRC EBADMSG /* Bad CRC detected */
> -#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> -
> #endif /* _LINUX_JBD2_H */
> diff --git a/include/uapi/asm-generic/errno.h b/include/uapi/asm-generic/errno.h
> index cf9c51ac49f97e..92e7ae493ee315 100644
> --- a/include/uapi/asm-generic/errno.h
> +++ b/include/uapi/asm-generic/errno.h
> @@ -55,6 +55,7 @@
> #define EMULTIHOP 72 /* Multihop attempted */
> #define EDOTDOT 73 /* RFS specific error */
> #define EBADMSG 74 /* Not a data message */
> +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> #define EOVERFLOW 75 /* Value too large for defined data type */
> #define ENOTUNIQ 76 /* Name not unique on network */
> #define EBADFD 77 /* File descriptor in bad state */
> @@ -98,6 +99,7 @@
> #define EINPROGRESS 115 /* Operation now in progress */
> #define ESTALE 116 /* Stale file handle */
> #define EUCLEAN 117 /* Structure needs cleaning */
> +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> #define ENOTNAM 118 /* Not a XENIX named type file */
> #define ENAVAIL 119 /* No XENIX semaphores available */
> #define EISNAM 120 /* Is a named type file */
> diff --git a/tools/arch/alpha/include/uapi/asm/errno.h b/tools/arch/alpha/include/uapi/asm/errno.h
> index 3d265f6babaf0a..6791f6508632ee 100644
> --- a/tools/arch/alpha/include/uapi/asm/errno.h
> +++ b/tools/arch/alpha/include/uapi/asm/errno.h
> @@ -55,6 +55,7 @@
> #define ENOSR 82 /* Out of streams resources */
> #define ETIME 83 /* Timer expired */
> #define EBADMSG 84 /* Not a data message */
> +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> #define EPROTO 85 /* Protocol error */
> #define ENODATA 86 /* No data available */
> #define ENOSTR 87 /* Device not a stream */
> @@ -96,6 +97,7 @@
> #define EREMCHG 115 /* Remote address changed */
>
> #define EUCLEAN 117 /* Structure needs cleaning */
> +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> #define ENOTNAM 118 /* Not a XENIX named type file */
> #define ENAVAIL 119 /* No XENIX semaphores available */
> #define EISNAM 120 /* Is a named type file */
> diff --git a/tools/arch/mips/include/uapi/asm/errno.h b/tools/arch/mips/include/uapi/asm/errno.h
> index 2fb714e2d6d8fc..c01ed91b1ef44b 100644
> --- a/tools/arch/mips/include/uapi/asm/errno.h
> +++ b/tools/arch/mips/include/uapi/asm/errno.h
> @@ -50,6 +50,7 @@
> #define EDOTDOT 73 /* RFS specific error */
> #define EMULTIHOP 74 /* Multihop attempted */
> #define EBADMSG 77 /* Not a data message */
> +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> #define ENAMETOOLONG 78 /* File name too long */
> #define EOVERFLOW 79 /* Value too large for defined data type */
> #define ENOTUNIQ 80 /* Name not unique on network */
> @@ -88,6 +89,7 @@
> #define EISCONN 133 /* Transport endpoint is already connected */
> #define ENOTCONN 134 /* Transport endpoint is not connected */
> #define EUCLEAN 135 /* Structure needs cleaning */
> +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> #define ENOTNAM 137 /* Not a XENIX named type file */
> #define ENAVAIL 138 /* No XENIX semaphores available */
> #define EISNAM 139 /* Is a named type file */
> diff --git a/tools/arch/parisc/include/uapi/asm/errno.h b/tools/arch/parisc/include/uapi/asm/errno.h
> index 8d94739d75c67c..8cbc07c1903e4c 100644
> --- a/tools/arch/parisc/include/uapi/asm/errno.h
> +++ b/tools/arch/parisc/include/uapi/asm/errno.h
> @@ -36,6 +36,7 @@
>
> #define EDOTDOT 66 /* RFS specific error */
> #define EBADMSG 67 /* Not a data message */
> +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> #define EUSERS 68 /* Too many users */
> #define EDQUOT 69 /* Quota exceeded */
> #define ESTALE 70 /* Stale file handle */
> @@ -62,6 +63,7 @@
> #define ERESTART 175 /* Interrupted system call should be restarted */
> #define ESTRPIPE 176 /* Streams pipe error */
> #define EUCLEAN 177 /* Structure needs cleaning */
> +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> #define ENOTNAM 178 /* Not a XENIX named type file */
> #define ENAVAIL 179 /* No XENIX semaphores available */
> #define EISNAM 180 /* Is a named type file */
> diff --git a/tools/arch/sparc/include/uapi/asm/errno.h b/tools/arch/sparc/include/uapi/asm/errno.h
> index 81a732b902ee38..4a41e7835fd5b8 100644
> --- a/tools/arch/sparc/include/uapi/asm/errno.h
> +++ b/tools/arch/sparc/include/uapi/asm/errno.h
> @@ -48,6 +48,7 @@
> #define ENOSR 74 /* Out of streams resources */
> #define ENOMSG 75 /* No message of desired type */
> #define EBADMSG 76 /* Not a data message */
> +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> #define EIDRM 77 /* Identifier removed */
> #define EDEADLK 78 /* Resource deadlock would occur */
> #define ENOLCK 79 /* No record locks available */
> @@ -91,6 +92,7 @@
> #define ENOTUNIQ 115 /* Name not unique on network */
> #define ERESTART 116 /* Interrupted syscall should be restarted */
> #define EUCLEAN 117 /* Structure needs cleaning */
> +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> #define ENOTNAM 118 /* Not a XENIX named type file */
> #define ENAVAIL 119 /* No XENIX semaphores available */
> #define EISNAM 120 /* Is a named type file */
> diff --git a/tools/include/uapi/asm-generic/errno.h b/tools/include/uapi/asm-generic/errno.h
> index cf9c51ac49f97e..92e7ae493ee315 100644
> --- a/tools/include/uapi/asm-generic/errno.h
> +++ b/tools/include/uapi/asm-generic/errno.h
> @@ -55,6 +55,7 @@
> #define EMULTIHOP 72 /* Multihop attempted */
> #define EDOTDOT 73 /* RFS specific error */
> #define EBADMSG 74 /* Not a data message */
> +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> #define EOVERFLOW 75 /* Value too large for defined data type */
> #define ENOTUNIQ 76 /* Name not unique on network */
> #define EBADFD 77 /* File descriptor in bad state */
> @@ -98,6 +99,7 @@
> #define EINPROGRESS 115 /* Operation now in progress */
> #define ESTALE 116 /* Stale file handle */
> #define EUCLEAN 117 /* Structure needs cleaning */
> +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> #define ENOTNAM 118 /* Not a XENIX named type file */
> #define ENAVAIL 119 /* No XENIX semaphores available */
> #define EISNAM 120 /* Is a named type file */
>
>
---end quoted text---
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/6] uapi: promote EFSCORRUPTED and EUCLEAN to errno.h
2025-12-18 2:02 ` [PATCH 1/6] uapi: promote EFSCORRUPTED and EUCLEAN to errno.h Darrick J. Wong
2025-12-18 5:17 ` Christoph Hellwig
@ 2025-12-18 9:33 ` Gao Xiang
2025-12-22 15:01 ` Jan Kara
2 siblings, 0 replies; 7+ messages in thread
From: Gao Xiang @ 2025-12-18 9:33 UTC (permalink / raw)
To: Darrick J. Wong, brauner
Cc: linux-api, linux-ext4, jack, linux-xfs, linux-fsdevel, gabriel,
hch, amir73il
On 2025/12/18 10:02, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
>
> Stop definining these privately and instead move them to the uapi
> errno.h so that they become canonical instead of copy pasta.
>
> Cc: linux-api@vger.kernel.org
> Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>
(...I really think it could be done earlier)
Thanks,
Gao Xiang
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/6] uapi: promote EFSCORRUPTED and EUCLEAN to errno.h
2025-12-18 5:17 ` Christoph Hellwig
@ 2025-12-18 11:04 ` Alejandro Colomar
2025-12-18 18:45 ` Darrick J. Wong
0 siblings, 1 reply; 7+ messages in thread
From: Alejandro Colomar @ 2025-12-18 11:04 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Darrick J. Wong, brauner, linux-api, linux-ext4, jack, linux-xfs,
linux-fsdevel, gabriel, amir73il, linux-man
[-- Attachment #1: Type: text/plain, Size: 16436 bytes --]
Hi Christoph,
On Wed, Dec 17, 2025 at 09:17:15PM -0800, Christoph Hellwig wrote:
> On Wed, Dec 17, 2025 at 06:02:56PM -0800, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@kernel.org>
> >
> > Stop definining these privately and instead move them to the uapi
> > errno.h so that they become canonical instead of copy pasta.
>
> Sounds fine:
>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
>
> Do we need to document these overlay errnos in the man man pages,
> though?
I'd say yes. errno(3) is where these are documented. Thanks for CCing.
Have a lovely day!
Alex
>
> >
> > Cc: linux-api@vger.kernel.org
> > Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
> > ---
> > arch/alpha/include/uapi/asm/errno.h | 2 ++
> > arch/mips/include/uapi/asm/errno.h | 2 ++
> > arch/parisc/include/uapi/asm/errno.h | 2 ++
> > arch/sparc/include/uapi/asm/errno.h | 2 ++
> > fs/erofs/internal.h | 2 --
> > fs/ext2/ext2.h | 1 -
> > fs/ext4/ext4.h | 3 ---
> > fs/f2fs/f2fs.h | 3 ---
> > fs/minix/minix.h | 2 --
> > fs/udf/udf_sb.h | 2 --
> > fs/xfs/xfs_linux.h | 2 --
> > include/linux/jbd2.h | 3 ---
> > include/uapi/asm-generic/errno.h | 2 ++
> > tools/arch/alpha/include/uapi/asm/errno.h | 2 ++
> > tools/arch/mips/include/uapi/asm/errno.h | 2 ++
> > tools/arch/parisc/include/uapi/asm/errno.h | 2 ++
> > tools/arch/sparc/include/uapi/asm/errno.h | 2 ++
> > tools/include/uapi/asm-generic/errno.h | 2 ++
> > 18 files changed, 20 insertions(+), 18 deletions(-)
> >
> >
> > diff --git a/arch/alpha/include/uapi/asm/errno.h b/arch/alpha/include/uapi/asm/errno.h
> > index 3d265f6babaf0a..6791f6508632ee 100644
> > --- a/arch/alpha/include/uapi/asm/errno.h
> > +++ b/arch/alpha/include/uapi/asm/errno.h
> > @@ -55,6 +55,7 @@
> > #define ENOSR 82 /* Out of streams resources */
> > #define ETIME 83 /* Timer expired */
> > #define EBADMSG 84 /* Not a data message */
> > +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> > #define EPROTO 85 /* Protocol error */
> > #define ENODATA 86 /* No data available */
> > #define ENOSTR 87 /* Device not a stream */
> > @@ -96,6 +97,7 @@
> > #define EREMCHG 115 /* Remote address changed */
> >
> > #define EUCLEAN 117 /* Structure needs cleaning */
> > +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> > #define ENOTNAM 118 /* Not a XENIX named type file */
> > #define ENAVAIL 119 /* No XENIX semaphores available */
> > #define EISNAM 120 /* Is a named type file */
> > diff --git a/arch/mips/include/uapi/asm/errno.h b/arch/mips/include/uapi/asm/errno.h
> > index 2fb714e2d6d8fc..c01ed91b1ef44b 100644
> > --- a/arch/mips/include/uapi/asm/errno.h
> > +++ b/arch/mips/include/uapi/asm/errno.h
> > @@ -50,6 +50,7 @@
> > #define EDOTDOT 73 /* RFS specific error */
> > #define EMULTIHOP 74 /* Multihop attempted */
> > #define EBADMSG 77 /* Not a data message */
> > +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> > #define ENAMETOOLONG 78 /* File name too long */
> > #define EOVERFLOW 79 /* Value too large for defined data type */
> > #define ENOTUNIQ 80 /* Name not unique on network */
> > @@ -88,6 +89,7 @@
> > #define EISCONN 133 /* Transport endpoint is already connected */
> > #define ENOTCONN 134 /* Transport endpoint is not connected */
> > #define EUCLEAN 135 /* Structure needs cleaning */
> > +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> > #define ENOTNAM 137 /* Not a XENIX named type file */
> > #define ENAVAIL 138 /* No XENIX semaphores available */
> > #define EISNAM 139 /* Is a named type file */
> > diff --git a/arch/parisc/include/uapi/asm/errno.h b/arch/parisc/include/uapi/asm/errno.h
> > index 8d94739d75c67c..8cbc07c1903e4c 100644
> > --- a/arch/parisc/include/uapi/asm/errno.h
> > +++ b/arch/parisc/include/uapi/asm/errno.h
> > @@ -36,6 +36,7 @@
> >
> > #define EDOTDOT 66 /* RFS specific error */
> > #define EBADMSG 67 /* Not a data message */
> > +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> > #define EUSERS 68 /* Too many users */
> > #define EDQUOT 69 /* Quota exceeded */
> > #define ESTALE 70 /* Stale file handle */
> > @@ -62,6 +63,7 @@
> > #define ERESTART 175 /* Interrupted system call should be restarted */
> > #define ESTRPIPE 176 /* Streams pipe error */
> > #define EUCLEAN 177 /* Structure needs cleaning */
> > +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> > #define ENOTNAM 178 /* Not a XENIX named type file */
> > #define ENAVAIL 179 /* No XENIX semaphores available */
> > #define EISNAM 180 /* Is a named type file */
> > diff --git a/arch/sparc/include/uapi/asm/errno.h b/arch/sparc/include/uapi/asm/errno.h
> > index 81a732b902ee38..4a41e7835fd5b8 100644
> > --- a/arch/sparc/include/uapi/asm/errno.h
> > +++ b/arch/sparc/include/uapi/asm/errno.h
> > @@ -48,6 +48,7 @@
> > #define ENOSR 74 /* Out of streams resources */
> > #define ENOMSG 75 /* No message of desired type */
> > #define EBADMSG 76 /* Not a data message */
> > +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> > #define EIDRM 77 /* Identifier removed */
> > #define EDEADLK 78 /* Resource deadlock would occur */
> > #define ENOLCK 79 /* No record locks available */
> > @@ -91,6 +92,7 @@
> > #define ENOTUNIQ 115 /* Name not unique on network */
> > #define ERESTART 116 /* Interrupted syscall should be restarted */
> > #define EUCLEAN 117 /* Structure needs cleaning */
> > +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> > #define ENOTNAM 118 /* Not a XENIX named type file */
> > #define ENAVAIL 119 /* No XENIX semaphores available */
> > #define EISNAM 120 /* Is a named type file */
> > diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h
> > index f7f622836198da..d06e99baf5d5ae 100644
> > --- a/fs/erofs/internal.h
> > +++ b/fs/erofs/internal.h
> > @@ -541,6 +541,4 @@ long erofs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
> > long erofs_compat_ioctl(struct file *filp, unsigned int cmd,
> > unsigned long arg);
> >
> > -#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> > -
> > #endif /* __EROFS_INTERNAL_H */
> > diff --git a/fs/ext2/ext2.h b/fs/ext2/ext2.h
> > index cf97b76e9fd3e9..5e0c6c5fcb6cd6 100644
> > --- a/fs/ext2/ext2.h
> > +++ b/fs/ext2/ext2.h
> > @@ -357,7 +357,6 @@ struct ext2_inode {
> > */
> > #define EXT2_VALID_FS 0x0001 /* Unmounted cleanly */
> > #define EXT2_ERROR_FS 0x0002 /* Errors detected */
> > -#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> >
> > /*
> > * Mount flags
> > diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
> > index 56112f201cace7..62c091b52bacdf 100644
> > --- a/fs/ext4/ext4.h
> > +++ b/fs/ext4/ext4.h
> > @@ -3938,7 +3938,4 @@ extern int ext4_block_write_begin(handle_t *handle, struct folio *folio,
> > get_block_t *get_block);
> > #endif /* __KERNEL__ */
> >
> > -#define EFSBADCRC EBADMSG /* Bad CRC detected */
> > -#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> > -
> > #endif /* _EXT4_H */
> > diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> > index 20edbb99b814a7..9f3aa3c7f12613 100644
> > --- a/fs/f2fs/f2fs.h
> > +++ b/fs/f2fs/f2fs.h
> > @@ -5004,7 +5004,4 @@ static inline void f2fs_invalidate_internal_cache(struct f2fs_sb_info *sbi,
> > f2fs_invalidate_compress_pages_range(sbi, blkaddr, len);
> > }
> >
> > -#define EFSBADCRC EBADMSG /* Bad CRC detected */
> > -#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> > -
> > #endif /* _LINUX_F2FS_H */
> > diff --git a/fs/minix/minix.h b/fs/minix/minix.h
> > index 2bfaf377f2086c..7e1f652f16d311 100644
> > --- a/fs/minix/minix.h
> > +++ b/fs/minix/minix.h
> > @@ -175,6 +175,4 @@ static inline int minix_test_bit(int nr, const void *vaddr)
> > __minix_error_inode((inode), __func__, __LINE__, \
> > (fmt), ##__VA_ARGS__)
> >
> > -#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> > -
> > #endif /* FS_MINIX_H */
> > diff --git a/fs/udf/udf_sb.h b/fs/udf/udf_sb.h
> > index 08ec8756b9487b..8399accc788dea 100644
> > --- a/fs/udf/udf_sb.h
> > +++ b/fs/udf/udf_sb.h
> > @@ -55,8 +55,6 @@
> > #define MF_DUPLICATE_MD 0x01
> > #define MF_MIRROR_FE_LOADED 0x02
> >
> > -#define EFSCORRUPTED EUCLEAN
> > -
> > struct udf_meta_data {
> > __u32 s_meta_file_loc;
> > __u32 s_mirror_file_loc;
> > diff --git a/fs/xfs/xfs_linux.h b/fs/xfs/xfs_linux.h
> > index 4dd747bdbccab2..55064228c4d574 100644
> > --- a/fs/xfs/xfs_linux.h
> > +++ b/fs/xfs/xfs_linux.h
> > @@ -121,8 +121,6 @@ typedef __u32 xfs_nlink_t;
> >
> > #define ENOATTR ENODATA /* Attribute not found */
> > #define EWRONGFS EINVAL /* Mount with wrong filesystem type */
> > -#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> > -#define EFSBADCRC EBADMSG /* Bad CRC detected */
> >
> > #define __return_address __builtin_return_address(0)
> >
> > diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
> > index f5eaf76198f377..a53a00d36228ce 100644
> > --- a/include/linux/jbd2.h
> > +++ b/include/linux/jbd2.h
> > @@ -1815,7 +1815,4 @@ static inline int jbd2_handle_buffer_credits(handle_t *handle)
> >
> > #endif /* __KERNEL__ */
> >
> > -#define EFSBADCRC EBADMSG /* Bad CRC detected */
> > -#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> > -
> > #endif /* _LINUX_JBD2_H */
> > diff --git a/include/uapi/asm-generic/errno.h b/include/uapi/asm-generic/errno.h
> > index cf9c51ac49f97e..92e7ae493ee315 100644
> > --- a/include/uapi/asm-generic/errno.h
> > +++ b/include/uapi/asm-generic/errno.h
> > @@ -55,6 +55,7 @@
> > #define EMULTIHOP 72 /* Multihop attempted */
> > #define EDOTDOT 73 /* RFS specific error */
> > #define EBADMSG 74 /* Not a data message */
> > +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> > #define EOVERFLOW 75 /* Value too large for defined data type */
> > #define ENOTUNIQ 76 /* Name not unique on network */
> > #define EBADFD 77 /* File descriptor in bad state */
> > @@ -98,6 +99,7 @@
> > #define EINPROGRESS 115 /* Operation now in progress */
> > #define ESTALE 116 /* Stale file handle */
> > #define EUCLEAN 117 /* Structure needs cleaning */
> > +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> > #define ENOTNAM 118 /* Not a XENIX named type file */
> > #define ENAVAIL 119 /* No XENIX semaphores available */
> > #define EISNAM 120 /* Is a named type file */
> > diff --git a/tools/arch/alpha/include/uapi/asm/errno.h b/tools/arch/alpha/include/uapi/asm/errno.h
> > index 3d265f6babaf0a..6791f6508632ee 100644
> > --- a/tools/arch/alpha/include/uapi/asm/errno.h
> > +++ b/tools/arch/alpha/include/uapi/asm/errno.h
> > @@ -55,6 +55,7 @@
> > #define ENOSR 82 /* Out of streams resources */
> > #define ETIME 83 /* Timer expired */
> > #define EBADMSG 84 /* Not a data message */
> > +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> > #define EPROTO 85 /* Protocol error */
> > #define ENODATA 86 /* No data available */
> > #define ENOSTR 87 /* Device not a stream */
> > @@ -96,6 +97,7 @@
> > #define EREMCHG 115 /* Remote address changed */
> >
> > #define EUCLEAN 117 /* Structure needs cleaning */
> > +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> > #define ENOTNAM 118 /* Not a XENIX named type file */
> > #define ENAVAIL 119 /* No XENIX semaphores available */
> > #define EISNAM 120 /* Is a named type file */
> > diff --git a/tools/arch/mips/include/uapi/asm/errno.h b/tools/arch/mips/include/uapi/asm/errno.h
> > index 2fb714e2d6d8fc..c01ed91b1ef44b 100644
> > --- a/tools/arch/mips/include/uapi/asm/errno.h
> > +++ b/tools/arch/mips/include/uapi/asm/errno.h
> > @@ -50,6 +50,7 @@
> > #define EDOTDOT 73 /* RFS specific error */
> > #define EMULTIHOP 74 /* Multihop attempted */
> > #define EBADMSG 77 /* Not a data message */
> > +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> > #define ENAMETOOLONG 78 /* File name too long */
> > #define EOVERFLOW 79 /* Value too large for defined data type */
> > #define ENOTUNIQ 80 /* Name not unique on network */
> > @@ -88,6 +89,7 @@
> > #define EISCONN 133 /* Transport endpoint is already connected */
> > #define ENOTCONN 134 /* Transport endpoint is not connected */
> > #define EUCLEAN 135 /* Structure needs cleaning */
> > +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> > #define ENOTNAM 137 /* Not a XENIX named type file */
> > #define ENAVAIL 138 /* No XENIX semaphores available */
> > #define EISNAM 139 /* Is a named type file */
> > diff --git a/tools/arch/parisc/include/uapi/asm/errno.h b/tools/arch/parisc/include/uapi/asm/errno.h
> > index 8d94739d75c67c..8cbc07c1903e4c 100644
> > --- a/tools/arch/parisc/include/uapi/asm/errno.h
> > +++ b/tools/arch/parisc/include/uapi/asm/errno.h
> > @@ -36,6 +36,7 @@
> >
> > #define EDOTDOT 66 /* RFS specific error */
> > #define EBADMSG 67 /* Not a data message */
> > +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> > #define EUSERS 68 /* Too many users */
> > #define EDQUOT 69 /* Quota exceeded */
> > #define ESTALE 70 /* Stale file handle */
> > @@ -62,6 +63,7 @@
> > #define ERESTART 175 /* Interrupted system call should be restarted */
> > #define ESTRPIPE 176 /* Streams pipe error */
> > #define EUCLEAN 177 /* Structure needs cleaning */
> > +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> > #define ENOTNAM 178 /* Not a XENIX named type file */
> > #define ENAVAIL 179 /* No XENIX semaphores available */
> > #define EISNAM 180 /* Is a named type file */
> > diff --git a/tools/arch/sparc/include/uapi/asm/errno.h b/tools/arch/sparc/include/uapi/asm/errno.h
> > index 81a732b902ee38..4a41e7835fd5b8 100644
> > --- a/tools/arch/sparc/include/uapi/asm/errno.h
> > +++ b/tools/arch/sparc/include/uapi/asm/errno.h
> > @@ -48,6 +48,7 @@
> > #define ENOSR 74 /* Out of streams resources */
> > #define ENOMSG 75 /* No message of desired type */
> > #define EBADMSG 76 /* Not a data message */
> > +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> > #define EIDRM 77 /* Identifier removed */
> > #define EDEADLK 78 /* Resource deadlock would occur */
> > #define ENOLCK 79 /* No record locks available */
> > @@ -91,6 +92,7 @@
> > #define ENOTUNIQ 115 /* Name not unique on network */
> > #define ERESTART 116 /* Interrupted syscall should be restarted */
> > #define EUCLEAN 117 /* Structure needs cleaning */
> > +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> > #define ENOTNAM 118 /* Not a XENIX named type file */
> > #define ENAVAIL 119 /* No XENIX semaphores available */
> > #define EISNAM 120 /* Is a named type file */
> > diff --git a/tools/include/uapi/asm-generic/errno.h b/tools/include/uapi/asm-generic/errno.h
> > index cf9c51ac49f97e..92e7ae493ee315 100644
> > --- a/tools/include/uapi/asm-generic/errno.h
> > +++ b/tools/include/uapi/asm-generic/errno.h
> > @@ -55,6 +55,7 @@
> > #define EMULTIHOP 72 /* Multihop attempted */
> > #define EDOTDOT 73 /* RFS specific error */
> > #define EBADMSG 74 /* Not a data message */
> > +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> > #define EOVERFLOW 75 /* Value too large for defined data type */
> > #define ENOTUNIQ 76 /* Name not unique on network */
> > #define EBADFD 77 /* File descriptor in bad state */
> > @@ -98,6 +99,7 @@
> > #define EINPROGRESS 115 /* Operation now in progress */
> > #define ESTALE 116 /* Stale file handle */
> > #define EUCLEAN 117 /* Structure needs cleaning */
> > +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> > #define ENOTNAM 118 /* Not a XENIX named type file */
> > #define ENAVAIL 119 /* No XENIX semaphores available */
> > #define EISNAM 120 /* Is a named type file */
> >
> >
> ---end quoted text---
>
--
<https://www.alejandro-colomar.es>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/6] uapi: promote EFSCORRUPTED and EUCLEAN to errno.h
2025-12-18 11:04 ` Alejandro Colomar
@ 2025-12-18 18:45 ` Darrick J. Wong
0 siblings, 0 replies; 7+ messages in thread
From: Darrick J. Wong @ 2025-12-18 18:45 UTC (permalink / raw)
To: Alejandro Colomar
Cc: Christoph Hellwig, brauner, linux-api, linux-ext4, jack,
linux-xfs, linux-fsdevel, gabriel, amir73il, linux-man
On Thu, Dec 18, 2025 at 12:04:11PM +0100, Alejandro Colomar wrote:
> Hi Christoph,
>
> On Wed, Dec 17, 2025 at 09:17:15PM -0800, Christoph Hellwig wrote:
> > On Wed, Dec 17, 2025 at 06:02:56PM -0800, Darrick J. Wong wrote:
> > > From: Darrick J. Wong <djwong@kernel.org>
> > >
> > > Stop definining these privately and instead move them to the uapi
> > > errno.h so that they become canonical instead of copy pasta.
> >
> > Sounds fine:
> >
> > Reviewed-by: Christoph Hellwig <hch@lst.de>
> >
> > Do we need to document these overlay errnos in the man man pages,
> > though?
>
> I'd say yes. errno(3) is where these are documented. Thanks for CCing.
I'll send a manpage update, thanks!
--D
>
> Have a lovely day!
> Alex
>
> >
> > >
> > > Cc: linux-api@vger.kernel.org
> > > Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
> > > ---
> > > arch/alpha/include/uapi/asm/errno.h | 2 ++
> > > arch/mips/include/uapi/asm/errno.h | 2 ++
> > > arch/parisc/include/uapi/asm/errno.h | 2 ++
> > > arch/sparc/include/uapi/asm/errno.h | 2 ++
> > > fs/erofs/internal.h | 2 --
> > > fs/ext2/ext2.h | 1 -
> > > fs/ext4/ext4.h | 3 ---
> > > fs/f2fs/f2fs.h | 3 ---
> > > fs/minix/minix.h | 2 --
> > > fs/udf/udf_sb.h | 2 --
> > > fs/xfs/xfs_linux.h | 2 --
> > > include/linux/jbd2.h | 3 ---
> > > include/uapi/asm-generic/errno.h | 2 ++
> > > tools/arch/alpha/include/uapi/asm/errno.h | 2 ++
> > > tools/arch/mips/include/uapi/asm/errno.h | 2 ++
> > > tools/arch/parisc/include/uapi/asm/errno.h | 2 ++
> > > tools/arch/sparc/include/uapi/asm/errno.h | 2 ++
> > > tools/include/uapi/asm-generic/errno.h | 2 ++
> > > 18 files changed, 20 insertions(+), 18 deletions(-)
> > >
> > >
> > > diff --git a/arch/alpha/include/uapi/asm/errno.h b/arch/alpha/include/uapi/asm/errno.h
> > > index 3d265f6babaf0a..6791f6508632ee 100644
> > > --- a/arch/alpha/include/uapi/asm/errno.h
> > > +++ b/arch/alpha/include/uapi/asm/errno.h
> > > @@ -55,6 +55,7 @@
> > > #define ENOSR 82 /* Out of streams resources */
> > > #define ETIME 83 /* Timer expired */
> > > #define EBADMSG 84 /* Not a data message */
> > > +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> > > #define EPROTO 85 /* Protocol error */
> > > #define ENODATA 86 /* No data available */
> > > #define ENOSTR 87 /* Device not a stream */
> > > @@ -96,6 +97,7 @@
> > > #define EREMCHG 115 /* Remote address changed */
> > >
> > > #define EUCLEAN 117 /* Structure needs cleaning */
> > > +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> > > #define ENOTNAM 118 /* Not a XENIX named type file */
> > > #define ENAVAIL 119 /* No XENIX semaphores available */
> > > #define EISNAM 120 /* Is a named type file */
> > > diff --git a/arch/mips/include/uapi/asm/errno.h b/arch/mips/include/uapi/asm/errno.h
> > > index 2fb714e2d6d8fc..c01ed91b1ef44b 100644
> > > --- a/arch/mips/include/uapi/asm/errno.h
> > > +++ b/arch/mips/include/uapi/asm/errno.h
> > > @@ -50,6 +50,7 @@
> > > #define EDOTDOT 73 /* RFS specific error */
> > > #define EMULTIHOP 74 /* Multihop attempted */
> > > #define EBADMSG 77 /* Not a data message */
> > > +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> > > #define ENAMETOOLONG 78 /* File name too long */
> > > #define EOVERFLOW 79 /* Value too large for defined data type */
> > > #define ENOTUNIQ 80 /* Name not unique on network */
> > > @@ -88,6 +89,7 @@
> > > #define EISCONN 133 /* Transport endpoint is already connected */
> > > #define ENOTCONN 134 /* Transport endpoint is not connected */
> > > #define EUCLEAN 135 /* Structure needs cleaning */
> > > +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> > > #define ENOTNAM 137 /* Not a XENIX named type file */
> > > #define ENAVAIL 138 /* No XENIX semaphores available */
> > > #define EISNAM 139 /* Is a named type file */
> > > diff --git a/arch/parisc/include/uapi/asm/errno.h b/arch/parisc/include/uapi/asm/errno.h
> > > index 8d94739d75c67c..8cbc07c1903e4c 100644
> > > --- a/arch/parisc/include/uapi/asm/errno.h
> > > +++ b/arch/parisc/include/uapi/asm/errno.h
> > > @@ -36,6 +36,7 @@
> > >
> > > #define EDOTDOT 66 /* RFS specific error */
> > > #define EBADMSG 67 /* Not a data message */
> > > +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> > > #define EUSERS 68 /* Too many users */
> > > #define EDQUOT 69 /* Quota exceeded */
> > > #define ESTALE 70 /* Stale file handle */
> > > @@ -62,6 +63,7 @@
> > > #define ERESTART 175 /* Interrupted system call should be restarted */
> > > #define ESTRPIPE 176 /* Streams pipe error */
> > > #define EUCLEAN 177 /* Structure needs cleaning */
> > > +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> > > #define ENOTNAM 178 /* Not a XENIX named type file */
> > > #define ENAVAIL 179 /* No XENIX semaphores available */
> > > #define EISNAM 180 /* Is a named type file */
> > > diff --git a/arch/sparc/include/uapi/asm/errno.h b/arch/sparc/include/uapi/asm/errno.h
> > > index 81a732b902ee38..4a41e7835fd5b8 100644
> > > --- a/arch/sparc/include/uapi/asm/errno.h
> > > +++ b/arch/sparc/include/uapi/asm/errno.h
> > > @@ -48,6 +48,7 @@
> > > #define ENOSR 74 /* Out of streams resources */
> > > #define ENOMSG 75 /* No message of desired type */
> > > #define EBADMSG 76 /* Not a data message */
> > > +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> > > #define EIDRM 77 /* Identifier removed */
> > > #define EDEADLK 78 /* Resource deadlock would occur */
> > > #define ENOLCK 79 /* No record locks available */
> > > @@ -91,6 +92,7 @@
> > > #define ENOTUNIQ 115 /* Name not unique on network */
> > > #define ERESTART 116 /* Interrupted syscall should be restarted */
> > > #define EUCLEAN 117 /* Structure needs cleaning */
> > > +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> > > #define ENOTNAM 118 /* Not a XENIX named type file */
> > > #define ENAVAIL 119 /* No XENIX semaphores available */
> > > #define EISNAM 120 /* Is a named type file */
> > > diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h
> > > index f7f622836198da..d06e99baf5d5ae 100644
> > > --- a/fs/erofs/internal.h
> > > +++ b/fs/erofs/internal.h
> > > @@ -541,6 +541,4 @@ long erofs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
> > > long erofs_compat_ioctl(struct file *filp, unsigned int cmd,
> > > unsigned long arg);
> > >
> > > -#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> > > -
> > > #endif /* __EROFS_INTERNAL_H */
> > > diff --git a/fs/ext2/ext2.h b/fs/ext2/ext2.h
> > > index cf97b76e9fd3e9..5e0c6c5fcb6cd6 100644
> > > --- a/fs/ext2/ext2.h
> > > +++ b/fs/ext2/ext2.h
> > > @@ -357,7 +357,6 @@ struct ext2_inode {
> > > */
> > > #define EXT2_VALID_FS 0x0001 /* Unmounted cleanly */
> > > #define EXT2_ERROR_FS 0x0002 /* Errors detected */
> > > -#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> > >
> > > /*
> > > * Mount flags
> > > diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
> > > index 56112f201cace7..62c091b52bacdf 100644
> > > --- a/fs/ext4/ext4.h
> > > +++ b/fs/ext4/ext4.h
> > > @@ -3938,7 +3938,4 @@ extern int ext4_block_write_begin(handle_t *handle, struct folio *folio,
> > > get_block_t *get_block);
> > > #endif /* __KERNEL__ */
> > >
> > > -#define EFSBADCRC EBADMSG /* Bad CRC detected */
> > > -#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> > > -
> > > #endif /* _EXT4_H */
> > > diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> > > index 20edbb99b814a7..9f3aa3c7f12613 100644
> > > --- a/fs/f2fs/f2fs.h
> > > +++ b/fs/f2fs/f2fs.h
> > > @@ -5004,7 +5004,4 @@ static inline void f2fs_invalidate_internal_cache(struct f2fs_sb_info *sbi,
> > > f2fs_invalidate_compress_pages_range(sbi, blkaddr, len);
> > > }
> > >
> > > -#define EFSBADCRC EBADMSG /* Bad CRC detected */
> > > -#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> > > -
> > > #endif /* _LINUX_F2FS_H */
> > > diff --git a/fs/minix/minix.h b/fs/minix/minix.h
> > > index 2bfaf377f2086c..7e1f652f16d311 100644
> > > --- a/fs/minix/minix.h
> > > +++ b/fs/minix/minix.h
> > > @@ -175,6 +175,4 @@ static inline int minix_test_bit(int nr, const void *vaddr)
> > > __minix_error_inode((inode), __func__, __LINE__, \
> > > (fmt), ##__VA_ARGS__)
> > >
> > > -#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> > > -
> > > #endif /* FS_MINIX_H */
> > > diff --git a/fs/udf/udf_sb.h b/fs/udf/udf_sb.h
> > > index 08ec8756b9487b..8399accc788dea 100644
> > > --- a/fs/udf/udf_sb.h
> > > +++ b/fs/udf/udf_sb.h
> > > @@ -55,8 +55,6 @@
> > > #define MF_DUPLICATE_MD 0x01
> > > #define MF_MIRROR_FE_LOADED 0x02
> > >
> > > -#define EFSCORRUPTED EUCLEAN
> > > -
> > > struct udf_meta_data {
> > > __u32 s_meta_file_loc;
> > > __u32 s_mirror_file_loc;
> > > diff --git a/fs/xfs/xfs_linux.h b/fs/xfs/xfs_linux.h
> > > index 4dd747bdbccab2..55064228c4d574 100644
> > > --- a/fs/xfs/xfs_linux.h
> > > +++ b/fs/xfs/xfs_linux.h
> > > @@ -121,8 +121,6 @@ typedef __u32 xfs_nlink_t;
> > >
> > > #define ENOATTR ENODATA /* Attribute not found */
> > > #define EWRONGFS EINVAL /* Mount with wrong filesystem type */
> > > -#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> > > -#define EFSBADCRC EBADMSG /* Bad CRC detected */
> > >
> > > #define __return_address __builtin_return_address(0)
> > >
> > > diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
> > > index f5eaf76198f377..a53a00d36228ce 100644
> > > --- a/include/linux/jbd2.h
> > > +++ b/include/linux/jbd2.h
> > > @@ -1815,7 +1815,4 @@ static inline int jbd2_handle_buffer_credits(handle_t *handle)
> > >
> > > #endif /* __KERNEL__ */
> > >
> > > -#define EFSBADCRC EBADMSG /* Bad CRC detected */
> > > -#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> > > -
> > > #endif /* _LINUX_JBD2_H */
> > > diff --git a/include/uapi/asm-generic/errno.h b/include/uapi/asm-generic/errno.h
> > > index cf9c51ac49f97e..92e7ae493ee315 100644
> > > --- a/include/uapi/asm-generic/errno.h
> > > +++ b/include/uapi/asm-generic/errno.h
> > > @@ -55,6 +55,7 @@
> > > #define EMULTIHOP 72 /* Multihop attempted */
> > > #define EDOTDOT 73 /* RFS specific error */
> > > #define EBADMSG 74 /* Not a data message */
> > > +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> > > #define EOVERFLOW 75 /* Value too large for defined data type */
> > > #define ENOTUNIQ 76 /* Name not unique on network */
> > > #define EBADFD 77 /* File descriptor in bad state */
> > > @@ -98,6 +99,7 @@
> > > #define EINPROGRESS 115 /* Operation now in progress */
> > > #define ESTALE 116 /* Stale file handle */
> > > #define EUCLEAN 117 /* Structure needs cleaning */
> > > +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> > > #define ENOTNAM 118 /* Not a XENIX named type file */
> > > #define ENAVAIL 119 /* No XENIX semaphores available */
> > > #define EISNAM 120 /* Is a named type file */
> > > diff --git a/tools/arch/alpha/include/uapi/asm/errno.h b/tools/arch/alpha/include/uapi/asm/errno.h
> > > index 3d265f6babaf0a..6791f6508632ee 100644
> > > --- a/tools/arch/alpha/include/uapi/asm/errno.h
> > > +++ b/tools/arch/alpha/include/uapi/asm/errno.h
> > > @@ -55,6 +55,7 @@
> > > #define ENOSR 82 /* Out of streams resources */
> > > #define ETIME 83 /* Timer expired */
> > > #define EBADMSG 84 /* Not a data message */
> > > +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> > > #define EPROTO 85 /* Protocol error */
> > > #define ENODATA 86 /* No data available */
> > > #define ENOSTR 87 /* Device not a stream */
> > > @@ -96,6 +97,7 @@
> > > #define EREMCHG 115 /* Remote address changed */
> > >
> > > #define EUCLEAN 117 /* Structure needs cleaning */
> > > +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> > > #define ENOTNAM 118 /* Not a XENIX named type file */
> > > #define ENAVAIL 119 /* No XENIX semaphores available */
> > > #define EISNAM 120 /* Is a named type file */
> > > diff --git a/tools/arch/mips/include/uapi/asm/errno.h b/tools/arch/mips/include/uapi/asm/errno.h
> > > index 2fb714e2d6d8fc..c01ed91b1ef44b 100644
> > > --- a/tools/arch/mips/include/uapi/asm/errno.h
> > > +++ b/tools/arch/mips/include/uapi/asm/errno.h
> > > @@ -50,6 +50,7 @@
> > > #define EDOTDOT 73 /* RFS specific error */
> > > #define EMULTIHOP 74 /* Multihop attempted */
> > > #define EBADMSG 77 /* Not a data message */
> > > +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> > > #define ENAMETOOLONG 78 /* File name too long */
> > > #define EOVERFLOW 79 /* Value too large for defined data type */
> > > #define ENOTUNIQ 80 /* Name not unique on network */
> > > @@ -88,6 +89,7 @@
> > > #define EISCONN 133 /* Transport endpoint is already connected */
> > > #define ENOTCONN 134 /* Transport endpoint is not connected */
> > > #define EUCLEAN 135 /* Structure needs cleaning */
> > > +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> > > #define ENOTNAM 137 /* Not a XENIX named type file */
> > > #define ENAVAIL 138 /* No XENIX semaphores available */
> > > #define EISNAM 139 /* Is a named type file */
> > > diff --git a/tools/arch/parisc/include/uapi/asm/errno.h b/tools/arch/parisc/include/uapi/asm/errno.h
> > > index 8d94739d75c67c..8cbc07c1903e4c 100644
> > > --- a/tools/arch/parisc/include/uapi/asm/errno.h
> > > +++ b/tools/arch/parisc/include/uapi/asm/errno.h
> > > @@ -36,6 +36,7 @@
> > >
> > > #define EDOTDOT 66 /* RFS specific error */
> > > #define EBADMSG 67 /* Not a data message */
> > > +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> > > #define EUSERS 68 /* Too many users */
> > > #define EDQUOT 69 /* Quota exceeded */
> > > #define ESTALE 70 /* Stale file handle */
> > > @@ -62,6 +63,7 @@
> > > #define ERESTART 175 /* Interrupted system call should be restarted */
> > > #define ESTRPIPE 176 /* Streams pipe error */
> > > #define EUCLEAN 177 /* Structure needs cleaning */
> > > +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> > > #define ENOTNAM 178 /* Not a XENIX named type file */
> > > #define ENAVAIL 179 /* No XENIX semaphores available */
> > > #define EISNAM 180 /* Is a named type file */
> > > diff --git a/tools/arch/sparc/include/uapi/asm/errno.h b/tools/arch/sparc/include/uapi/asm/errno.h
> > > index 81a732b902ee38..4a41e7835fd5b8 100644
> > > --- a/tools/arch/sparc/include/uapi/asm/errno.h
> > > +++ b/tools/arch/sparc/include/uapi/asm/errno.h
> > > @@ -48,6 +48,7 @@
> > > #define ENOSR 74 /* Out of streams resources */
> > > #define ENOMSG 75 /* No message of desired type */
> > > #define EBADMSG 76 /* Not a data message */
> > > +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> > > #define EIDRM 77 /* Identifier removed */
> > > #define EDEADLK 78 /* Resource deadlock would occur */
> > > #define ENOLCK 79 /* No record locks available */
> > > @@ -91,6 +92,7 @@
> > > #define ENOTUNIQ 115 /* Name not unique on network */
> > > #define ERESTART 116 /* Interrupted syscall should be restarted */
> > > #define EUCLEAN 117 /* Structure needs cleaning */
> > > +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> > > #define ENOTNAM 118 /* Not a XENIX named type file */
> > > #define ENAVAIL 119 /* No XENIX semaphores available */
> > > #define EISNAM 120 /* Is a named type file */
> > > diff --git a/tools/include/uapi/asm-generic/errno.h b/tools/include/uapi/asm-generic/errno.h
> > > index cf9c51ac49f97e..92e7ae493ee315 100644
> > > --- a/tools/include/uapi/asm-generic/errno.h
> > > +++ b/tools/include/uapi/asm-generic/errno.h
> > > @@ -55,6 +55,7 @@
> > > #define EMULTIHOP 72 /* Multihop attempted */
> > > #define EDOTDOT 73 /* RFS specific error */
> > > #define EBADMSG 74 /* Not a data message */
> > > +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> > > #define EOVERFLOW 75 /* Value too large for defined data type */
> > > #define ENOTUNIQ 76 /* Name not unique on network */
> > > #define EBADFD 77 /* File descriptor in bad state */
> > > @@ -98,6 +99,7 @@
> > > #define EINPROGRESS 115 /* Operation now in progress */
> > > #define ESTALE 116 /* Stale file handle */
> > > #define EUCLEAN 117 /* Structure needs cleaning */
> > > +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> > > #define ENOTNAM 118 /* Not a XENIX named type file */
> > > #define ENAVAIL 119 /* No XENIX semaphores available */
> > > #define EISNAM 120 /* Is a named type file */
> > >
> > >
> > ---end quoted text---
> >
>
> --
> <https://www.alejandro-colomar.es>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/6] uapi: promote EFSCORRUPTED and EUCLEAN to errno.h
2025-12-18 2:02 ` [PATCH 1/6] uapi: promote EFSCORRUPTED and EUCLEAN to errno.h Darrick J. Wong
2025-12-18 5:17 ` Christoph Hellwig
2025-12-18 9:33 ` Gao Xiang
@ 2025-12-22 15:01 ` Jan Kara
2 siblings, 0 replies; 7+ messages in thread
From: Jan Kara @ 2025-12-22 15:01 UTC (permalink / raw)
To: Darrick J. Wong
Cc: brauner, linux-api, linux-ext4, jack, linux-xfs, linux-fsdevel,
gabriel, hch, amir73il
On Wed 17-12-25 18:02:56, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
>
> Stop definining these privately and instead move them to the uapi
> errno.h so that they become canonical instead of copy pasta.
>
> Cc: linux-api@vger.kernel.org
> Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Looks good. Feel free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> arch/alpha/include/uapi/asm/errno.h | 2 ++
> arch/mips/include/uapi/asm/errno.h | 2 ++
> arch/parisc/include/uapi/asm/errno.h | 2 ++
> arch/sparc/include/uapi/asm/errno.h | 2 ++
> fs/erofs/internal.h | 2 --
> fs/ext2/ext2.h | 1 -
> fs/ext4/ext4.h | 3 ---
> fs/f2fs/f2fs.h | 3 ---
> fs/minix/minix.h | 2 --
> fs/udf/udf_sb.h | 2 --
> fs/xfs/xfs_linux.h | 2 --
> include/linux/jbd2.h | 3 ---
> include/uapi/asm-generic/errno.h | 2 ++
> tools/arch/alpha/include/uapi/asm/errno.h | 2 ++
> tools/arch/mips/include/uapi/asm/errno.h | 2 ++
> tools/arch/parisc/include/uapi/asm/errno.h | 2 ++
> tools/arch/sparc/include/uapi/asm/errno.h | 2 ++
> tools/include/uapi/asm-generic/errno.h | 2 ++
> 18 files changed, 20 insertions(+), 18 deletions(-)
>
>
> diff --git a/arch/alpha/include/uapi/asm/errno.h b/arch/alpha/include/uapi/asm/errno.h
> index 3d265f6babaf0a..6791f6508632ee 100644
> --- a/arch/alpha/include/uapi/asm/errno.h
> +++ b/arch/alpha/include/uapi/asm/errno.h
> @@ -55,6 +55,7 @@
> #define ENOSR 82 /* Out of streams resources */
> #define ETIME 83 /* Timer expired */
> #define EBADMSG 84 /* Not a data message */
> +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> #define EPROTO 85 /* Protocol error */
> #define ENODATA 86 /* No data available */
> #define ENOSTR 87 /* Device not a stream */
> @@ -96,6 +97,7 @@
> #define EREMCHG 115 /* Remote address changed */
>
> #define EUCLEAN 117 /* Structure needs cleaning */
> +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> #define ENOTNAM 118 /* Not a XENIX named type file */
> #define ENAVAIL 119 /* No XENIX semaphores available */
> #define EISNAM 120 /* Is a named type file */
> diff --git a/arch/mips/include/uapi/asm/errno.h b/arch/mips/include/uapi/asm/errno.h
> index 2fb714e2d6d8fc..c01ed91b1ef44b 100644
> --- a/arch/mips/include/uapi/asm/errno.h
> +++ b/arch/mips/include/uapi/asm/errno.h
> @@ -50,6 +50,7 @@
> #define EDOTDOT 73 /* RFS specific error */
> #define EMULTIHOP 74 /* Multihop attempted */
> #define EBADMSG 77 /* Not a data message */
> +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> #define ENAMETOOLONG 78 /* File name too long */
> #define EOVERFLOW 79 /* Value too large for defined data type */
> #define ENOTUNIQ 80 /* Name not unique on network */
> @@ -88,6 +89,7 @@
> #define EISCONN 133 /* Transport endpoint is already connected */
> #define ENOTCONN 134 /* Transport endpoint is not connected */
> #define EUCLEAN 135 /* Structure needs cleaning */
> +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> #define ENOTNAM 137 /* Not a XENIX named type file */
> #define ENAVAIL 138 /* No XENIX semaphores available */
> #define EISNAM 139 /* Is a named type file */
> diff --git a/arch/parisc/include/uapi/asm/errno.h b/arch/parisc/include/uapi/asm/errno.h
> index 8d94739d75c67c..8cbc07c1903e4c 100644
> --- a/arch/parisc/include/uapi/asm/errno.h
> +++ b/arch/parisc/include/uapi/asm/errno.h
> @@ -36,6 +36,7 @@
>
> #define EDOTDOT 66 /* RFS specific error */
> #define EBADMSG 67 /* Not a data message */
> +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> #define EUSERS 68 /* Too many users */
> #define EDQUOT 69 /* Quota exceeded */
> #define ESTALE 70 /* Stale file handle */
> @@ -62,6 +63,7 @@
> #define ERESTART 175 /* Interrupted system call should be restarted */
> #define ESTRPIPE 176 /* Streams pipe error */
> #define EUCLEAN 177 /* Structure needs cleaning */
> +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> #define ENOTNAM 178 /* Not a XENIX named type file */
> #define ENAVAIL 179 /* No XENIX semaphores available */
> #define EISNAM 180 /* Is a named type file */
> diff --git a/arch/sparc/include/uapi/asm/errno.h b/arch/sparc/include/uapi/asm/errno.h
> index 81a732b902ee38..4a41e7835fd5b8 100644
> --- a/arch/sparc/include/uapi/asm/errno.h
> +++ b/arch/sparc/include/uapi/asm/errno.h
> @@ -48,6 +48,7 @@
> #define ENOSR 74 /* Out of streams resources */
> #define ENOMSG 75 /* No message of desired type */
> #define EBADMSG 76 /* Not a data message */
> +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> #define EIDRM 77 /* Identifier removed */
> #define EDEADLK 78 /* Resource deadlock would occur */
> #define ENOLCK 79 /* No record locks available */
> @@ -91,6 +92,7 @@
> #define ENOTUNIQ 115 /* Name not unique on network */
> #define ERESTART 116 /* Interrupted syscall should be restarted */
> #define EUCLEAN 117 /* Structure needs cleaning */
> +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> #define ENOTNAM 118 /* Not a XENIX named type file */
> #define ENAVAIL 119 /* No XENIX semaphores available */
> #define EISNAM 120 /* Is a named type file */
> diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h
> index f7f622836198da..d06e99baf5d5ae 100644
> --- a/fs/erofs/internal.h
> +++ b/fs/erofs/internal.h
> @@ -541,6 +541,4 @@ long erofs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
> long erofs_compat_ioctl(struct file *filp, unsigned int cmd,
> unsigned long arg);
>
> -#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> -
> #endif /* __EROFS_INTERNAL_H */
> diff --git a/fs/ext2/ext2.h b/fs/ext2/ext2.h
> index cf97b76e9fd3e9..5e0c6c5fcb6cd6 100644
> --- a/fs/ext2/ext2.h
> +++ b/fs/ext2/ext2.h
> @@ -357,7 +357,6 @@ struct ext2_inode {
> */
> #define EXT2_VALID_FS 0x0001 /* Unmounted cleanly */
> #define EXT2_ERROR_FS 0x0002 /* Errors detected */
> -#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
>
> /*
> * Mount flags
> diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
> index 56112f201cace7..62c091b52bacdf 100644
> --- a/fs/ext4/ext4.h
> +++ b/fs/ext4/ext4.h
> @@ -3938,7 +3938,4 @@ extern int ext4_block_write_begin(handle_t *handle, struct folio *folio,
> get_block_t *get_block);
> #endif /* __KERNEL__ */
>
> -#define EFSBADCRC EBADMSG /* Bad CRC detected */
> -#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> -
> #endif /* _EXT4_H */
> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> index 20edbb99b814a7..9f3aa3c7f12613 100644
> --- a/fs/f2fs/f2fs.h
> +++ b/fs/f2fs/f2fs.h
> @@ -5004,7 +5004,4 @@ static inline void f2fs_invalidate_internal_cache(struct f2fs_sb_info *sbi,
> f2fs_invalidate_compress_pages_range(sbi, blkaddr, len);
> }
>
> -#define EFSBADCRC EBADMSG /* Bad CRC detected */
> -#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> -
> #endif /* _LINUX_F2FS_H */
> diff --git a/fs/minix/minix.h b/fs/minix/minix.h
> index 2bfaf377f2086c..7e1f652f16d311 100644
> --- a/fs/minix/minix.h
> +++ b/fs/minix/minix.h
> @@ -175,6 +175,4 @@ static inline int minix_test_bit(int nr, const void *vaddr)
> __minix_error_inode((inode), __func__, __LINE__, \
> (fmt), ##__VA_ARGS__)
>
> -#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> -
> #endif /* FS_MINIX_H */
> diff --git a/fs/udf/udf_sb.h b/fs/udf/udf_sb.h
> index 08ec8756b9487b..8399accc788dea 100644
> --- a/fs/udf/udf_sb.h
> +++ b/fs/udf/udf_sb.h
> @@ -55,8 +55,6 @@
> #define MF_DUPLICATE_MD 0x01
> #define MF_MIRROR_FE_LOADED 0x02
>
> -#define EFSCORRUPTED EUCLEAN
> -
> struct udf_meta_data {
> __u32 s_meta_file_loc;
> __u32 s_mirror_file_loc;
> diff --git a/fs/xfs/xfs_linux.h b/fs/xfs/xfs_linux.h
> index 4dd747bdbccab2..55064228c4d574 100644
> --- a/fs/xfs/xfs_linux.h
> +++ b/fs/xfs/xfs_linux.h
> @@ -121,8 +121,6 @@ typedef __u32 xfs_nlink_t;
>
> #define ENOATTR ENODATA /* Attribute not found */
> #define EWRONGFS EINVAL /* Mount with wrong filesystem type */
> -#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> -#define EFSBADCRC EBADMSG /* Bad CRC detected */
>
> #define __return_address __builtin_return_address(0)
>
> diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
> index f5eaf76198f377..a53a00d36228ce 100644
> --- a/include/linux/jbd2.h
> +++ b/include/linux/jbd2.h
> @@ -1815,7 +1815,4 @@ static inline int jbd2_handle_buffer_credits(handle_t *handle)
>
> #endif /* __KERNEL__ */
>
> -#define EFSBADCRC EBADMSG /* Bad CRC detected */
> -#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> -
> #endif /* _LINUX_JBD2_H */
> diff --git a/include/uapi/asm-generic/errno.h b/include/uapi/asm-generic/errno.h
> index cf9c51ac49f97e..92e7ae493ee315 100644
> --- a/include/uapi/asm-generic/errno.h
> +++ b/include/uapi/asm-generic/errno.h
> @@ -55,6 +55,7 @@
> #define EMULTIHOP 72 /* Multihop attempted */
> #define EDOTDOT 73 /* RFS specific error */
> #define EBADMSG 74 /* Not a data message */
> +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> #define EOVERFLOW 75 /* Value too large for defined data type */
> #define ENOTUNIQ 76 /* Name not unique on network */
> #define EBADFD 77 /* File descriptor in bad state */
> @@ -98,6 +99,7 @@
> #define EINPROGRESS 115 /* Operation now in progress */
> #define ESTALE 116 /* Stale file handle */
> #define EUCLEAN 117 /* Structure needs cleaning */
> +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> #define ENOTNAM 118 /* Not a XENIX named type file */
> #define ENAVAIL 119 /* No XENIX semaphores available */
> #define EISNAM 120 /* Is a named type file */
> diff --git a/tools/arch/alpha/include/uapi/asm/errno.h b/tools/arch/alpha/include/uapi/asm/errno.h
> index 3d265f6babaf0a..6791f6508632ee 100644
> --- a/tools/arch/alpha/include/uapi/asm/errno.h
> +++ b/tools/arch/alpha/include/uapi/asm/errno.h
> @@ -55,6 +55,7 @@
> #define ENOSR 82 /* Out of streams resources */
> #define ETIME 83 /* Timer expired */
> #define EBADMSG 84 /* Not a data message */
> +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> #define EPROTO 85 /* Protocol error */
> #define ENODATA 86 /* No data available */
> #define ENOSTR 87 /* Device not a stream */
> @@ -96,6 +97,7 @@
> #define EREMCHG 115 /* Remote address changed */
>
> #define EUCLEAN 117 /* Structure needs cleaning */
> +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> #define ENOTNAM 118 /* Not a XENIX named type file */
> #define ENAVAIL 119 /* No XENIX semaphores available */
> #define EISNAM 120 /* Is a named type file */
> diff --git a/tools/arch/mips/include/uapi/asm/errno.h b/tools/arch/mips/include/uapi/asm/errno.h
> index 2fb714e2d6d8fc..c01ed91b1ef44b 100644
> --- a/tools/arch/mips/include/uapi/asm/errno.h
> +++ b/tools/arch/mips/include/uapi/asm/errno.h
> @@ -50,6 +50,7 @@
> #define EDOTDOT 73 /* RFS specific error */
> #define EMULTIHOP 74 /* Multihop attempted */
> #define EBADMSG 77 /* Not a data message */
> +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> #define ENAMETOOLONG 78 /* File name too long */
> #define EOVERFLOW 79 /* Value too large for defined data type */
> #define ENOTUNIQ 80 /* Name not unique on network */
> @@ -88,6 +89,7 @@
> #define EISCONN 133 /* Transport endpoint is already connected */
> #define ENOTCONN 134 /* Transport endpoint is not connected */
> #define EUCLEAN 135 /* Structure needs cleaning */
> +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> #define ENOTNAM 137 /* Not a XENIX named type file */
> #define ENAVAIL 138 /* No XENIX semaphores available */
> #define EISNAM 139 /* Is a named type file */
> diff --git a/tools/arch/parisc/include/uapi/asm/errno.h b/tools/arch/parisc/include/uapi/asm/errno.h
> index 8d94739d75c67c..8cbc07c1903e4c 100644
> --- a/tools/arch/parisc/include/uapi/asm/errno.h
> +++ b/tools/arch/parisc/include/uapi/asm/errno.h
> @@ -36,6 +36,7 @@
>
> #define EDOTDOT 66 /* RFS specific error */
> #define EBADMSG 67 /* Not a data message */
> +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> #define EUSERS 68 /* Too many users */
> #define EDQUOT 69 /* Quota exceeded */
> #define ESTALE 70 /* Stale file handle */
> @@ -62,6 +63,7 @@
> #define ERESTART 175 /* Interrupted system call should be restarted */
> #define ESTRPIPE 176 /* Streams pipe error */
> #define EUCLEAN 177 /* Structure needs cleaning */
> +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> #define ENOTNAM 178 /* Not a XENIX named type file */
> #define ENAVAIL 179 /* No XENIX semaphores available */
> #define EISNAM 180 /* Is a named type file */
> diff --git a/tools/arch/sparc/include/uapi/asm/errno.h b/tools/arch/sparc/include/uapi/asm/errno.h
> index 81a732b902ee38..4a41e7835fd5b8 100644
> --- a/tools/arch/sparc/include/uapi/asm/errno.h
> +++ b/tools/arch/sparc/include/uapi/asm/errno.h
> @@ -48,6 +48,7 @@
> #define ENOSR 74 /* Out of streams resources */
> #define ENOMSG 75 /* No message of desired type */
> #define EBADMSG 76 /* Not a data message */
> +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> #define EIDRM 77 /* Identifier removed */
> #define EDEADLK 78 /* Resource deadlock would occur */
> #define ENOLCK 79 /* No record locks available */
> @@ -91,6 +92,7 @@
> #define ENOTUNIQ 115 /* Name not unique on network */
> #define ERESTART 116 /* Interrupted syscall should be restarted */
> #define EUCLEAN 117 /* Structure needs cleaning */
> +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> #define ENOTNAM 118 /* Not a XENIX named type file */
> #define ENAVAIL 119 /* No XENIX semaphores available */
> #define EISNAM 120 /* Is a named type file */
> diff --git a/tools/include/uapi/asm-generic/errno.h b/tools/include/uapi/asm-generic/errno.h
> index cf9c51ac49f97e..92e7ae493ee315 100644
> --- a/tools/include/uapi/asm-generic/errno.h
> +++ b/tools/include/uapi/asm-generic/errno.h
> @@ -55,6 +55,7 @@
> #define EMULTIHOP 72 /* Multihop attempted */
> #define EDOTDOT 73 /* RFS specific error */
> #define EBADMSG 74 /* Not a data message */
> +#define EFSBADCRC EBADMSG /* Bad CRC detected */
> #define EOVERFLOW 75 /* Value too large for defined data type */
> #define ENOTUNIQ 76 /* Name not unique on network */
> #define EBADFD 77 /* File descriptor in bad state */
> @@ -98,6 +99,7 @@
> #define EINPROGRESS 115 /* Operation now in progress */
> #define ESTALE 116 /* Stale file handle */
> #define EUCLEAN 117 /* Structure needs cleaning */
> +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
> #define ENOTNAM 118 /* Not a XENIX named type file */
> #define ENAVAIL 119 /* No XENIX semaphores available */
> #define EISNAM 120 /* Is a named type file */
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-12-22 15:01 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-18 2:02 [PATCHSET V4 1/2] fs: generic file IO error reporting Darrick J. Wong
2025-12-18 2:02 ` [PATCH 1/6] uapi: promote EFSCORRUPTED and EUCLEAN to errno.h Darrick J. Wong
2025-12-18 5:17 ` Christoph Hellwig
2025-12-18 11:04 ` Alejandro Colomar
2025-12-18 18:45 ` Darrick J. Wong
2025-12-18 9:33 ` Gao Xiang
2025-12-22 15:01 ` Jan Kara
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).