]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfsprogs-dev.git/commitdiff
xfs: convey file I/O errors to the health monitor
authorDarrick J. Wong <djwong@kernel.org>
Sun, 22 Feb 2026 22:41:04 +0000 (14:41 -0800)
committerAndrey Albershteyn <aalbersh@kernel.org>
Wed, 8 Apr 2026 19:39:56 +0000 (21:39 +0200)
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" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
libxfs/xfs_fs.h

index 38aeb1b0d87b5e63e6bb28ef5a39d553ec309ad5..4ec1b2aede976f6ddd72a2f23c8f2ba2d73a17ab 100644 (file)
@@ -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 */