Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1016911pxj; Fri, 21 May 2021 04:40:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0j8LWL96wK37xSPrQf7Lvo6AHnauZ8OTfqQ7zTieYAQmhL81vM/y5s7+eOn2UEK9Jzndt X-Received: by 2002:a17:906:6ada:: with SMTP id q26mr10267280ejs.237.1621597220091; Fri, 21 May 2021 04:40:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621597220; cv=none; d=google.com; s=arc-20160816; b=TMJpHiLKU6zqLfX96TfDxit87JHd09al47fMra9epB8fFJ0lIbZSGfsWZDV6syk0tJ DNNqZwLM3iMyngNkIhsLR1eMiWhxW/DvOfL2whkdyeIMoP/IzH+ixGpQG4ZUjmJOBPm3 totRraqUZw7O3R7STw3WWcwbTyFOOI/+8gkmorp7AYudchOllKy+GQ1dpu1C4csUoKwP lNZEfs0i5bcWPNgrQ/NEjXXNlM7B2EK7DuY9derx+Sjd3RCtFLTyAMVqaClYxabd8aet tAUmYLRmDM7LJXJelalz6BJo0sIddguBq0gk2q3g1NK1M5Ck3S5jRkGvENN3H/wANb9y VsIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=69oB8MFLDZscaHQtc1gsfahitoPKORHWiL8/2xC8oEw=; b=VpGRg670gQmU0bf7MJ8OZPuOk7+hL0RCi2cblA0piXNEoNDmUuAuQx2WSKJJkhcl+f 5zsjtFAIRzyl4vbQqz0ffHPuHBkNkysRaQWuU2AZqw456oP/8ixopK8iQi5zBCHxpOgt Z8xX9/IQGyz9Bz4WpIqGtk35k+21e7Vatmae0iqX4Dg+p6MY+Qj6/xZg2vFBVvpytv9w Le8g8ZHpI6pKbfFZdqJwoUv/YAhSWObs31qN8CSKa2LoICMuH/xq2Nm52aRCa3gKF/2G xavHdwfTEFIJenYcL65ldbG3kGwQZstzrdHbdp8JDZgbpF+8GlMUrq1l3+CkE3caK8DV XL8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HrHXsqO8; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d23si2960943edp.175.2021.05.21.04.39.31; Fri, 21 May 2021 04:40:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HrHXsqO8; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231377AbhEUJ7l (ORCPT + 99 others); Fri, 21 May 2021 05:59:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237348AbhEUJ55 (ORCPT ); Fri, 21 May 2021 05:57:57 -0400 Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3FA4C061374; Fri, 21 May 2021 02:54:17 -0700 (PDT) Received: by mail-io1-xd2d.google.com with SMTP id o21so19528367iow.13; Fri, 21 May 2021 02:54:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=69oB8MFLDZscaHQtc1gsfahitoPKORHWiL8/2xC8oEw=; b=HrHXsqO8M2nlu+nncOl7KgmQD2OzEuuhFtPGbTUdzamqJ9kI/xjBODymDPS6H9FgT0 AdZOxFuHEXIVykmNjjR/PNvlW7fEM2Eyuv+9AaLkz5QEfp9AC8zDNK+UmvFeKbzfGQ9t Ia/gr8oMm14Miox8O+tEaGlufM+6D2dy9ds/u95ZFDsDd2EB/xyK5WzglkPuEi02Fvd9 +1RMDjPpcVMrLm2BNFZgM+/7TaCx+wdB2h6HoeXHd/niENufifJReLUSxzSld10Tc3oA 2oBo1LHIVZsgCstuT1DAhOa/krW2FCtJ8QuPutOg/UV1NBMHSYt1+EgyS93KAzQu8jPx jwlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=69oB8MFLDZscaHQtc1gsfahitoPKORHWiL8/2xC8oEw=; b=btIPhHBK+BRVW3TMXFnVWQWDFK7Hborsc8Bt3WrMobe/2YsTleXJNKldaO8RcXP0sX j+4R9GJlxCdr28esbYhlvPJIZzr0CvjZSbfKR856gHSfeP9Gnt89n3z22vQBXGlGOfmS 2m5aIymrDGBNbFkdaOdzoI/HXlEZL7yKq4X15HHB347yI/rjaL0P8WwZAEhfKELR0/wY QhKQwqRyDgQJAdj9xU1NV6HkCo2TZJx98K2DEmOcfatkzWpy6k3Q2RRuUbOMeA9O8FFT GHbm93OFPf5yqPAwLosxVCFbZCBoQQEEAgy4wj+w8pfgMmcUip3IbKemqK7QLj4x6ORd wCug== X-Gm-Message-State: AOAM533J3OkYlOUFEacETMtTaFe4ytwPOCq3xkzY4aoh5xGXlgsI6zDE 1GNqVjA8sGt94qD8EktsA2dCNQ7BZlrqMyxQpx0= X-Received: by 2002:a02:3505:: with SMTP id k5mr3277378jaa.123.1621590857099; Fri, 21 May 2021 02:54:17 -0700 (PDT) MIME-Version: 1.0 References: <20210521024134.1032503-1-krisman@collabora.com> <20210521024134.1032503-12-krisman@collabora.com> In-Reply-To: <20210521024134.1032503-12-krisman@collabora.com> From: Amir Goldstein Date: Fri, 21 May 2021 12:54:06 +0300 Message-ID: Subject: Re: [PATCH 11/11] Documentation: Document the FAN_ERROR event To: Gabriel Krisman Bertazi Cc: kernel@collabora.com, "Darrick J . Wong" , "Theodore Ts'o" , Dave Chinner , Jan Kara , David Howells , Khazhismel Kumykov , linux-fsdevel , Ext4 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Fri, May 21, 2021 at 5:42 AM Gabriel Krisman Bertazi wrote: > > Signed-off-by: Gabriel Krisman Bertazi > --- > .../admin-guide/filesystem-monitoring.rst | 52 +++++++++++++++++++ > Documentation/admin-guide/index.rst | 1 + > 2 files changed, 53 insertions(+) > create mode 100644 Documentation/admin-guide/filesystem-monitoring.rst > > diff --git a/Documentation/admin-guide/filesystem-monitoring.rst b/Documentation/admin-guide/filesystem-monitoring.rst > new file mode 100644 > index 000000000000..81e632f8e1de > --- /dev/null > +++ b/Documentation/admin-guide/filesystem-monitoring.rst > @@ -0,0 +1,52 @@ > +.. SPDX-License-Identifier: GPL-2.0 > + > +==================================== > +File system Monitoring with fanotify > +==================================== > + > +fanotify supports the FAN_ERROR mark for file system-wide error > +reporting. It is meant to be used by file system health monitoring > +daemons who listen on that interface and take actions (notify sysadmin, > +start recovery) when a file system problem is detected by the kernel. > + > +By design, A FAN_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 outside of > +scope of this feature. Instead, it is only meant as a framework for > +early file system problem detection and reporting recovery tools. > + > +At the time of this writing, the only file system that emits this > +FAN_ERROR notifications is ext4. > + > +A user space example code is provided at ``samples/fanotify/fs-monitor.c``. > + > +Usage > +===== > + > +Notification structure > +====================== > + > +A FAN_ERROR Notification has the following format:: > + > + [ Notification Metadata (Mandatory) ] > + [ Generic Error Record (Mandatory) ] > + > +With the exception of the notification metadata and the generic > +information, all information records are optional. Each record type is > +identified by its unique ``struct fanotify_event_info_header.info_type``. Out-dated. Unless you decide to add support for optional FID record. > + > +Generic error Location 'Location' seems irrelevant? > +---------------------- > + > +The Generic error record provides enough information for a file system > +agnostic tool to learn about a problem in the file system, without > +requiring any details about the problem.:: > + > + struct fanotify_event_info_error { > + struct fanotify_event_info_header hdr; > + int error; > + __kernel_fsid_t fsid; > + unsigned long inode; > + __u32 error_count; > + }; Maybe add some text about the fact the inode info is optional, purpose of error_count and the fact that the info is related to the first observed error. Thanks, Amir.