€•î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ŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ5/translations/pt_BR/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.”…””}”(hj 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.”…””}”(hj(h²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:”…””}”(hj6h²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) ]”…””}”hjFsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jDh³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 ”…””}”(hjTh²hh³Nh´NubhŒliteral”“”)”}”(hŒ!``samples/fanotify/fs-monitor.c``”h]”hŒsamples/fanotify/fs-monitor.c”…””}”(hj^h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j\hjTubhŒ for an example parser.”…””}”(hjTh²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”…””}”(hjyh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjvh²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 ”…””}”(hj‡h²hh³Nh´Nubj])”}”(hŒ/``struct fanotify_event_info_header.info_type``”h]”hŒ+struct fanotify_event_info_header.info_type”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j\hj‡ubhŒ( being set to FAN_EVENT_INFO_TYPE_ERROR.”…””}”(hj‡h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K4hjvh²hubhŒ block_quote”“”)”}”(hŒ:: struct fanotify_event_info_error { struct fanotify_event_info_header hdr; __s32 error; __u32 error_count; }; ”h]”jE)”}”(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Æuh1jDh³hÇh´K