From: Darrick J. Wong Date: Sun, 22 Feb 2026 22:41:04 +0000 (-0800) Subject: xfs: convey file I/O errors to the health monitor X-Git-Tag: v7.0.0~89 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=00cb02ecf24b273b4bd9ab158bfa2e6e1a301a63;p=xfsprogs-dev.git xfs: convey file I/O errors to the health monitor Source kernel commit: dfa8bad3a8796ce1ca4f1d15158e2ecfb9c5c014 Connect the fserror reporting to the health monitor so that xfs can send events about file I/O errors to the xfs_healer daemon. These events are entirely informational because xfs cannot regenerate user data, so hopefully the fsnotify I/O error event gets noticed by the relevant management systems. Signed-off-by: "Darrick J. Wong" Reviewed-by: Christoph Hellwig --- diff --git a/libxfs/xfs_fs.h b/libxfs/xfs_fs.h index 38aeb1b0..4ec1b2ae 100644 --- a/libxfs/xfs_fs.h +++ b/libxfs/xfs_fs.h @@ -1019,6 +1019,9 @@ struct xfs_rtgroup_geometry { #define XFS_HEALTH_MONITOR_DOMAIN_RTDEV (6) #define XFS_HEALTH_MONITOR_DOMAIN_LOGDEV (7) +/* file range events */ +#define XFS_HEALTH_MONITOR_DOMAIN_FILERANGE (8) + /* Health monitor event types */ /* status of the monitor itself */ @@ -1039,6 +1042,17 @@ struct xfs_rtgroup_geometry { /* media errors */ #define XFS_HEALTH_MONITOR_TYPE_MEDIA_ERROR (7) +/* pagecache I/O to a file range failed */ +#define XFS_HEALTH_MONITOR_TYPE_BUFREAD (8) +#define XFS_HEALTH_MONITOR_TYPE_BUFWRITE (9) + +/* direct I/O to a file range failed */ +#define XFS_HEALTH_MONITOR_TYPE_DIOREAD (10) +#define XFS_HEALTH_MONITOR_TYPE_DIOWRITE (11) + +/* out of band media error reported for a file range */ +#define XFS_HEALTH_MONITOR_TYPE_DATALOST (12) + /* lost events */ struct xfs_health_monitor_lost { __u64 count; @@ -1079,6 +1093,15 @@ struct xfs_health_monitor_shutdown { __u32 reasons; }; +/* file range events */ +struct xfs_health_monitor_filerange { + __u64 pos; + __u64 len; + __u64 ino; + __u32 gen; + __u32 error; +}; + /* disk media errors */ struct xfs_health_monitor_media { __u64 daddr; @@ -1107,6 +1130,7 @@ struct xfs_health_monitor_event { struct xfs_health_monitor_inode inode; struct xfs_health_monitor_shutdown shutdown; struct xfs_health_monitor_media media; + struct xfs_health_monitor_filerange filerange; } e; /* zeroes */