€• 1Œsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ5/translations/zh_CN/admin-guide/filesystem-monitoring”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ5/translations/zh_TW/admin-guide/filesystem-monitoring”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ5/translations/it_IT/admin-guide/filesystem-monitoring”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ5/translations/ja_JP/admin-guide/filesystem-monitoring”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ5/translations/ko_KR/admin-guide/filesystem-monitoring”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ5/translations/sp_SP/admin-guide/filesystem-monitoring”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)”}”(hŒ SPDX-License-Identifier: GPL-2.0”h]”hŒ SPDX-License-Identifier: GPL-2.0”…””}”hh£sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1h¡hhhžhhŸŒO/var/lib/git/docbuild/linux/Documentation/admin-guide/filesystem-monitoring.rst”h KubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒ$File system Monitoring with fanotify”h]”hŒ$File system Monitoring with fanotify”…””}”(hh»hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hh¶hžhhŸh³h Kubhµ)”}”(hhh]”(hº)”}”(hŒFile system Error Reporting”h]”hŒFile system Error Reporting”…””}”(hhÌhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hhÉhžhhŸh³h KubhŒ paragraph”“”)”}”(hXFanotify supports the FAN_FS_ERROR event type for file system-wide error reporting. It is meant to be used by file system health monitoring daemons, which listen for these events and take actions (notify sysadmin, start recovery) when a file system problem is detected.”h]”hXFanotify supports the FAN_FS_ERROR event type for file system-wide error reporting. It is meant to be used by file system health monitoring daemons, which listen for these events and take actions (notify sysadmin, start recovery) when a file system problem is detected.”…””}”(hhÜhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h K hhÉhžhubhÛ)”}”(hX¢By design, a FAN_FS_ERROR notification exposes sufficient information for a monitoring tool to know a problem in the file system has happened. It doesn't necessarily provide a user space application with semantics to verify an IO operation was successfully executed. That is out of scope for this feature. Instead, it is only meant as a framework for early file system problem detection and reporting recovery tools.”h]”hX¤By design, a FAN_FS_ERROR notification exposes sufficient information for a monitoring tool to know a problem in the file system has happened. It doesn’t necessarily provide a user space application with semantics to verify an IO operation was successfully executed. That is out of scope for this feature. Instead, it is only meant as a framework for early file system problem detection and reporting recovery tools.”…””}”(hhêhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h KhhÉhžhubhÛ)”}”(hXÑWhen a file system operation fails, it is common for dozens of kernel errors to cascade after the initial failure, hiding the original failure log, which is usually the most useful debug data to troubleshoot the problem. For this reason, FAN_FS_ERROR tries to report only the first error that occurred for a file system since the last notification, and it simply counts additional errors. This ensures that the most important pieces of information are never lost.”h]”hXÑWhen a file system operation fails, it is common for dozens of kernel errors to cascade after the initial failure, hiding the original failure log, which is usually the most useful debug data to troubleshoot the problem. For this reason, FAN_FS_ERROR tries to report only the first error that occurred for a file system since the last notification, and it simply counts additional errors. This ensures that the most important pieces of information are never lost.”…””}”(hhøhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h KhhÉhžhubhÛ)”}”(hŒRFAN_FS_ERROR requires the fanotify group to be setup with the FAN_REPORT_FID flag.”h]”hŒRFAN_FS_ERROR requires the fanotify group to be setup with the FAN_REPORT_FID flag.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h KhhÉhžhubhÛ)”}”(hŒ`At the time of this writing, the only file system that emits FAN_FS_ERROR notifications is Ext4.”h]”hŒ`At the time of this writing, the only file system that emits FAN_FS_ERROR notifications is Ext4.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h K!hhÉhžhubhÛ)”}”(hŒ6A FAN_FS_ERROR Notification has the following format::”h]”hŒ5A FAN_FS_ERROR Notification has the following format:”…””}”(hj"hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h K$hhÉhžhubhŒ literal_block”“”)”}”(hŒ~:: [ Notification Metadata (Mandatory) ] [ Generic Error Record (Mandatory) ] [ FID record (Mandatory) ]”h]”hŒ~:: [ Notification Metadata (Mandatory) ] [ Generic Error Record (Mandatory) ] [ FID record (Mandatory) ]”…””}”hj2sbah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1j0hŸh³h K&hhÉhžhubhÛ)”}”(hXThe order of records is not guaranteed, and new records might be added in the future. Therefore, applications must not rely on the order and must be prepared to skip over unknown records. Please refer to ``samples/fanotify/fs-monitor.c`` for an example parser.”h]”(hŒÍThe order of records is not guaranteed, and new records might be added in the future. Therefore, applications must not rely on the order and must be prepared to skip over unknown records. Please refer to ”…””}”(hj@hžhhŸNh NubhŒliteral”“”)”}”(hŒ!``samples/fanotify/fs-monitor.c``”h]”hŒsamples/fanotify/fs-monitor.c”…””}”(hjJhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jHhj@ubhŒ for an example parser.”…””}”(hj@hžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h K,hhÉhžhubhµ)”}”(hhh]”(hº)”}”(hŒGeneric error record”h]”hŒGeneric error record”…””}”(hjehžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hjbhžhhŸh³h K2ubhÛ)”}”(hX3The generic error record provides enough information for a file system agnostic tool to learn about a problem in the file system, without providing any additional details about the problem. This record is identified by ``struct fanotify_event_info_header.info_type`` being set to FAN_EVENT_INFO_TYPE_ERROR.”h]”(hŒÜThe generic error record provides enough information for a file system agnostic tool to learn about a problem in the file system, without providing any additional details about the problem. This record is identified by ”…””}”(hjshžhhŸNh NubjI)”}”(hŒ/``struct fanotify_event_info_header.info_type``”h]”hŒ+struct fanotify_event_info_header.info_type”…””}”(hj{hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jHhjsubhŒ( being set to FAN_EVENT_INFO_TYPE_ERROR.”…””}”(hjshžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h K4hjbhžhubhŒ block_quote”“”)”}”(hŒ:: struct fanotify_event_info_error { struct fanotify_event_info_header hdr; __s32 error; __u32 error_count; }; ”h]”j1)”}”(hŒystruct fanotify_event_info_error { struct fanotify_event_info_header hdr; __s32 error; __u32 error_count; };”h]”hŒystruct fanotify_event_info_error { struct fanotify_event_info_header hdr; __s32 error; __u32 error_count; };”…””}”hj™sbah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1j0hŸh³h K