From: Darrick J. Wong Date: Sun, 22 Feb 2026 22:41:04 +0000 (-0800) Subject: xfs: convey filesystem shutdown events to the health monitor X-Git-Tag: v7.0.0~91 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=47ab0cd74ec5b2b87b28755e5d4717fde7c7c9c9;p=xfsprogs-dev.git xfs: convey filesystem shutdown events to the health monitor Source kernel commit: 74c4795e50f816dbf5cf094691fc4f95bbc729ad Connect the filesystem shutdown code to the health monitor so that xfs can send events about that to the xfs_healer daemon. Signed-off-by: "Darrick J. Wong" Reviewed-by: Christoph Hellwig --- diff --git a/libxfs/xfs_fs.h b/libxfs/xfs_fs.h index 04e1dcf6..c8f7011a 100644 --- a/libxfs/xfs_fs.h +++ b/libxfs/xfs_fs.h @@ -1028,6 +1028,9 @@ struct xfs_rtgroup_geometry { #define XFS_HEALTH_MONITOR_TYPE_CORRUPT (4) #define XFS_HEALTH_MONITOR_TYPE_HEALTHY (5) +/* filesystem shutdown */ +#define XFS_HEALTH_MONITOR_TYPE_SHUTDOWN (6) + /* lost events */ struct xfs_health_monitor_lost { __u64 count; @@ -1054,6 +1057,20 @@ struct xfs_health_monitor_inode { __u64 ino; }; +/* shutdown reasons */ +#define XFS_HEALTH_SHUTDOWN_META_IO_ERROR (1u << 0) +#define XFS_HEALTH_SHUTDOWN_LOG_IO_ERROR (1u << 1) +#define XFS_HEALTH_SHUTDOWN_FORCE_UMOUNT (1u << 2) +#define XFS_HEALTH_SHUTDOWN_CORRUPT_INCORE (1u << 3) +#define XFS_HEALTH_SHUTDOWN_CORRUPT_ONDISK (1u << 4) +#define XFS_HEALTH_SHUTDOWN_DEVICE_REMOVED (1u << 5) + +/* shutdown */ +struct xfs_health_monitor_shutdown { + /* XFS_HEALTH_SHUTDOWN_* flags */ + __u32 reasons; +}; + struct xfs_health_monitor_event { /* XFS_HEALTH_MONITOR_DOMAIN_* */ __u32 domain; @@ -1074,6 +1091,7 @@ struct xfs_health_monitor_event { struct xfs_health_monitor_fs fs; struct xfs_health_monitor_group group; struct xfs_health_monitor_inode inode; + struct xfs_health_monitor_shutdown shutdown; } e; /* zeroes */