]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
xfs: report media errors through healthmon
authorDarrick J. Wong <djwong@kernel.org>
Wed, 7 Aug 2024 22:54:55 +0000 (15:54 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Wed, 14 Aug 2024 03:08:26 +0000 (20:08 -0700)
Now that we have hooks to report media errors, connect this to the
health monitor as well.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
libxfs/xfs_healthmon.schema.json

index 495d868ddea291bcad61f6e860fe9373ef19c176..784b314263a3951d6bd2f7ee3e0796d5cb5f0efc 100644 (file)
@@ -36,6 +36,9 @@
                },
                {
                        "$ref": "#/$events/shutdown"
+               },
+               {
+                       "$ref": "#/$events/media_error"
                }
        ],
 
                "i_generation": {
                        "description": "Inode generation number",
                        "type": "integer"
+               },
+               "storage_devs": {
+                       "description": "Storage devices in a filesystem",
+                       "_comment": [
+                               "One of:",
+                               "",
+                               " * datadev: filesystem device",
+                               " * logdev:  external log device",
+                               " * rtdev:   realtime volume"
+                       ],
+                       "enum": [
+                               "datadev",
+                               "logdev",
+                               "rtdev"
+                       ]
+               },
+               "xfs_daddr_t": {
+                       "description": "Storage device address, in units of 512-byte blocks",
+                       "type": "integer",
+                       "minimum": 0
+               },
+               "bbcount": {
+                       "description": "Storage space length, in units of 512-byte blocks",
+                       "type": "integer",
+                       "minimum": 1
                }
        },
 
                                "domain",
                                "reasons"
                        ]
+               },
+               "media_error": {
+                       "title": "Media Error",
+                       "description": [
+                               "A storage device reported a media error.",
+                               "The domain element tells us which storage",
+                               "device reported the media failure.  The",
+                               "daddr and bbcount elements tell us where",
+                               "inside that device the failure was observed."
+                       ],
+                       "type": "object",
+
+                       "properties": {
+                               "type": {
+                                       "const": "media"
+                               },
+                               "time_ns": {
+                                       "$ref": "#/$defs/time_ns"
+                               },
+                               "domain": {
+                                       "$ref": "#/$defs/storage_devs"
+                               },
+                               "daddr": {
+                                       "$ref": "#/$defs/xfs_daddr_t"
+                               },
+                               "bbcount": {
+                                       "$ref": "#/$defs/bbcount"
+                               }
+                       },
+
+                       "required": [
+                               "type",
+                               "time_ns",
+                               "domain",
+                               "daddr",
+                               "bbcount"
+                       ]
                }
        }
 }