]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfsprogs-dev.git/commitdiff
xfs: convey externally discovered fsdax media 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: e76e0e3fc9957a5183ddc51dc84c3e471125ab06

Connect the fsdax media failure notification code to the health monitor
so that xfs can send events about that to the xfs_healer daemon.

Later on we'll add the ability for the xfs_scrub media scan (phase 6) to
report the errors that it finds to the kernel so that those are also
logged by xfs_healer.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
libxfs/xfs_fs.h

index c8f7011a7ef8efca3dda8917bfbed0ac4915053a..38aeb1b0d87b5e63e6bb28ef5a39d553ec309ad5 100644 (file)
@@ -1014,6 +1014,11 @@ struct xfs_rtgroup_geometry {
 #define XFS_HEALTH_MONITOR_DOMAIN_INODE                (3)
 #define XFS_HEALTH_MONITOR_DOMAIN_RTGROUP      (4)
 
+/* disk events */
+#define XFS_HEALTH_MONITOR_DOMAIN_DATADEV      (5)
+#define XFS_HEALTH_MONITOR_DOMAIN_RTDEV                (6)
+#define XFS_HEALTH_MONITOR_DOMAIN_LOGDEV       (7)
+
 /* Health monitor event types */
 
 /* status of the monitor itself */
@@ -1031,6 +1036,9 @@ struct xfs_rtgroup_geometry {
 /* filesystem shutdown */
 #define XFS_HEALTH_MONITOR_TYPE_SHUTDOWN       (6)
 
+/* media errors */
+#define XFS_HEALTH_MONITOR_TYPE_MEDIA_ERROR    (7)
+
 /* lost events */
 struct xfs_health_monitor_lost {
        __u64   count;
@@ -1071,6 +1079,12 @@ struct xfs_health_monitor_shutdown {
        __u32   reasons;
 };
 
+/* disk media errors */
+struct xfs_health_monitor_media {
+       __u64   daddr;
+       __u64   bbcount;
+};
+
 struct xfs_health_monitor_event {
        /* XFS_HEALTH_MONITOR_DOMAIN_* */
        __u32   domain;
@@ -1092,6 +1106,7 @@ struct xfs_health_monitor_event {
                struct xfs_health_monitor_group group;
                struct xfs_health_monitor_inode inode;
                struct xfs_health_monitor_shutdown shutdown;
+               struct xfs_health_monitor_media media;
        } e;
 
        /* zeroes */