public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCHSET v5] fs: generic file IO error reporting
@ 2026-01-13  0:31 Darrick J. Wong
  2026-01-13  0:31 ` [PATCH 1/6] uapi: promote EFSCORRUPTED and EUCLEAN to errno.h Darrick J. Wong
                   ` (6 more replies)
  0 siblings, 7 replies; 21+ messages in thread
From: Darrick J. Wong @ 2026-01-13  0:31 UTC (permalink / raw)
  To: djwong, brauner
  Cc: linux-api, jack, hch, hsiangkao, linux-xfs, jack, linux-ext4,
	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 series which will
come at a later time.

v5: tidy comments, un-inline the unmount function
v4: drag out of RFC status, finalize the sign of errnos that we accept

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                    |   75 +++++++++++
 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                               |  194 ++++++++++++++++++++++++++++
 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, 373 insertions(+), 24 deletions(-)
 create mode 100644 include/linux/fserror.h
 create mode 100644 fs/fserror.c


^ permalink raw reply	[flat|nested] 21+ messages in thread
* [PATCHSET V4 1/2] fs: generic file IO error reporting
@ 2025-12-18  2:02 Darrick J. Wong
  2025-12-18  2:03 ` [PATCH 2/6] fs: report filesystem and file I/O errors to fsnotify Darrick J. Wong
  0 siblings, 1 reply; 21+ 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] 21+ messages in thread

end of thread, other threads:[~2026-01-15 16:45 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-13  0:31 [PATCHSET v5] fs: generic file IO error reporting Darrick J. Wong
2026-01-13  0:31 ` [PATCH 1/6] uapi: promote EFSCORRUPTED and EUCLEAN to errno.h Darrick J. Wong
2026-01-13  0:31 ` [PATCH 2/6] fs: report filesystem and file I/O errors to fsnotify Darrick J. Wong
2026-01-13  8:24   ` Christoph Hellwig
2026-01-13  0:31 ` [PATCH 3/6] iomap: report file I/O errors to the VFS Darrick J. Wong
2026-01-13  0:31 ` [PATCH 4/6] xfs: report fs metadata errors via fsnotify Darrick J. Wong
2026-01-13  0:32 ` [PATCH 5/6] xfs: translate fsdax media errors into file "data lost" errors when convenient Darrick J. Wong
2026-01-13  0:32 ` [PATCH 6/6] ext4: convert to new fserror helpers Darrick J. Wong
2026-01-13  0:56   ` Gabriel Krisman Bertazi
2026-01-13  1:26     ` Darrick J. Wong
2026-01-15 15:29   ` Theodore Tso
2026-01-13  8:58 ` [PATCHSET v5] fs: generic file IO error reporting Christian Brauner
  -- strict thread matches above, loose matches on Subject: below --
2025-12-18  2:02 [PATCHSET V4 1/2] " Darrick J. Wong
2025-12-18  2:03 ` [PATCH 2/6] fs: report filesystem and file I/O errors to fsnotify Darrick J. Wong
2025-12-18  5:21   ` Christoph Hellwig
2025-12-18 18:44     ` Darrick J. Wong
2025-12-24 12:29       ` Christian Brauner
2026-01-06 16:42         ` Darrick J. Wong
2026-01-12 13:17           ` Christian Brauner
2026-01-12 18:50             ` Darrick J. Wong
2025-12-22 15:36   ` Jan Kara
2026-01-06 17:35     ` Darrick J. Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox