Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3500213pxb; Mon, 18 Oct 2021 17:01:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8rZ6tqxlMmiuN4PVdcr8VWQdbQP6tllOyEWVKBJZp/RNUn+dkKyTPIMGArYdpFvPIqD6T X-Received: by 2002:a17:906:912:: with SMTP id i18mr33074850ejd.131.1634601675115; Mon, 18 Oct 2021 17:01:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634601675; cv=none; d=google.com; s=arc-20160816; b=WAdx2HBY7g/8Jb9eN9TIfqNabk8OYWh7A5x2KwTwYCb41AHm8GlYA5Q9behBaLV7II IS1rEqTolgSCmvjIVd2VgfCOdp1sRzQNOriO0LV0ENU9Q4Zx4GZrelI7Yk0+VR33Zo/r YhJrQ6qNRedqd5u6l2X9JiFFE63pt1gpS/LQJjCGx4gvWSNxXD9onbY0iGpYBkXnN13L 0dPWQ0eX5/teTH2HhziFbt874zYb/6HR8DRMuEbUkB9xQF2k9w+lVU6/mHLZc67ievBR j0M3x1jxpfeVGoHPI1jI4BgNOZC7acaIpxjTwwm/du89r367/Ywx68KzQTJn6VmW8S+l 0ktg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=tu0SIDB5iga0HVnrUGgU9KQ+pOU54YkC+U87YTxzVAY=; b=tPPHXXv2Od5b4WdgweyfqSVMMSKLCRLRMRSQS6QsFybw3iY4eHe12V03s4I64sWtMt 7JconUc0a0fpzy4VnSMnJoGxLuxnop6VD/kguNKtnpkAp+KDGjopclePbsMZpx1oQaFq EQFMgHmyEt0s+ELnk17/n581QXPKCB3D3XPG4O5VjvDYUx1DLy50+mihfplb9WBGB9lm O58UkP5slmX/uAahoAC41sfH055aUAmfCJzCGFg9dgHhhFgwhnjGi4TL03cgMk7ZyJCB GGO/y+jlFhKNDJL0WyzuL+ujhsxskkMsGJnsTVtwT/355hYKHqx6dHZyBO3+OEQAkOk5 ndfQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d2si20222196edy.32.2021.10.18.17.00.40; Mon, 18 Oct 2021 17:01:15 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229588AbhJSACj (ORCPT + 99 others); Mon, 18 Oct 2021 20:02:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229529AbhJSACi (ORCPT ); Mon, 18 Oct 2021 20:02:38 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17E17C06161C; Mon, 18 Oct 2021 17:00:27 -0700 (PDT) Received: from localhost (unknown [IPv6:2804:14c:124:8a08::1007]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: krisman) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 5962E1F41A9C; Tue, 19 Oct 2021 01:00:24 +0100 (BST) From: Gabriel Krisman Bertazi To: jack@suse.com, amir73il@gmail.com Cc: djwong@kernel.org, tytso@mit.edu, david@fromorbit.com, dhowells@redhat.com, khazhy@google.com, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-api@vger.kernel.org, Gabriel Krisman Bertazi , kernel@collabora.com Subject: [PATCH v8 00/32] file system-wide error monitoring Date: Mon, 18 Oct 2021 20:59:43 -0300 Message-Id: <20211019000015.1666608-1-krisman@collabora.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Hi, This is the 8th version of this patch series. We are getting close! Thank you Amir and Jan for your repeated assistance in getting this in shape. This version applies all your feedback from previous version, in particular, it has a resizeable mempool, such that we don't waste to much space if not needed. This was tested with LTP for regressions and also using the sample code on the last patch, with a corrupted image. I wrote a new ltp test for this feature which is being reviewed and is available at: https://gitlab.collabora.com/krisman/ltp -b fan-fs-error In addition, I wrote a man-page that can be pulled from: https://gitlab.collabora.com/krisman/man-pages.git -b fan-fs-error And is being reviewed at the list. I also pushed this full series to: https://gitlab.collabora.com/krisman/linux -b fanotify-notifications-v8 Thank you Cc: Darrick J. Wong Cc: Theodore Ts'o Cc: Dave Chinner Cc: jack@suse.com To: amir73il@gmail.com Cc: dhowells@redhat.com Cc: khazhy@google.com Cc: linux-fsdevel@vger.kernel.org Cc: linux-ext4@vger.kernel.org Cc: linux-api@vger.kernel.org Cc: linux-api@vger.kernel.org Amir Goldstein (3): fsnotify: pass data_type to fsnotify_name() fsnotify: pass dentry instead of inode data fsnotify: clarify contract for create event hooks Gabriel Krisman Bertazi (29): fsnotify: Don't insert unmergeable events in hashtable fanotify: Fold event size calculation to its own function fanotify: Split fsid check from other fid mode checks inotify: Don't force FS_IN_IGNORED fsnotify: Add helper to detect overflow_event fsnotify: Add wrapper around fsnotify_add_event fsnotify: Retrieve super block from the data field fsnotify: Protect fsnotify_handle_inode_event from no-inode events fsnotify: Pass group argument to free_event fanotify: Support null inode event in fanotify_dfid_inode fanotify: Allow file handle encoding for unhashed events fanotify: Encode empty file handle when no inode is provided fanotify: Require fid_mode for any non-fd event fsnotify: Support FS_ERROR event type fanotify: Reserve UAPI bits for FAN_FS_ERROR fanotify: Pre-allocate pool of error events fanotify: Dynamically resize the FAN_FS_ERROR pool fanotify: Support enqueueing of error events fanotify: Support merging of error events fanotify: Wrap object_fh inline space in a creator macro fanotify: Add helpers to decide whether to report FID/DFID fanotify: Report fid entry even for zero-length file_handle fanotify: WARN_ON against too large file handles fanotify: Report fid info for file related file system errors fanotify: Emit generic error info for error event fanotify: Allow users to request FAN_FS_ERROR events ext4: Send notifications on error samples: Add fs error monitoring example docs: Document the FAN_FS_ERROR event .../admin-guide/filesystem-monitoring.rst | 76 ++++++++ Documentation/admin-guide/index.rst | 1 + fs/ext4/super.c | 8 + fs/notify/fanotify/fanotify.c | 116 +++++++++++- fs/notify/fanotify/fanotify.h | 60 +++++- fs/notify/fanotify/fanotify_user.c | 172 ++++++++++++++---- fs/notify/fsnotify.c | 10 +- fs/notify/group.c | 2 +- fs/notify/inotify/inotify_fsnotify.c | 5 +- fs/notify/inotify/inotify_user.c | 6 +- fs/notify/notification.c | 14 +- include/linux/fanotify.h | 9 +- include/linux/fsnotify.h | 58 ++++-- include/linux/fsnotify_backend.h | 96 +++++++++- include/uapi/linux/fanotify.h | 8 + kernel/audit_fsnotify.c | 3 +- kernel/audit_watch.c | 3 +- samples/Kconfig | 9 + samples/Makefile | 1 + samples/fanotify/Makefile | 5 + samples/fanotify/fs-monitor.c | 142 +++++++++++++++ 21 files changed, 705 insertions(+), 99 deletions(-) create mode 100644 Documentation/admin-guide/filesystem-monitoring.rst create mode 100644 samples/fanotify/Makefile create mode 100644 samples/fanotify/fs-monitor.c -- 2.33.0