From patchwork Wed Jul 24 19:06:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 1964464 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=RfjekoAj; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org (client-ip=2404:9400:2221:ea00::3; helo=mail.ozlabs.org; envelope-from=srs0=ic2o=oy=vger.kernel.org=linux-ext4+bounces-3433-patchwork-incoming=ozlabs.org@ozlabs.org; receiver=patchwork.ozlabs.org) Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WTk5p3RpGz1yZw for ; Thu, 25 Jul 2024 05:06:54 +1000 (AEST) Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4WTk5p317lz4wnx for ; Thu, 25 Jul 2024 05:06:54 +1000 (AEST) Received: by gandalf.ozlabs.org (Postfix) id 4WTk5p2y0Pz4x0t; Thu, 25 Jul 2024 05:06:54 +1000 (AEST) Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: gandalf.ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: gandalf.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=RfjekoAj; dkim-atps=neutral Authentication-Results: gandalf.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:40f1:3f00::1; helo=sy.mirrors.kernel.org; envelope-from=linux-ext4+bounces-3433-patchwork-incoming=ozlabs.org@vger.kernel.org; receiver=ozlabs.org) Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org [IPv6:2604:1380:40f1:3f00::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by gandalf.ozlabs.org (Postfix) with ESMTPS id 4WTk5p2rlMz4wnx for ; Thu, 25 Jul 2024 05:06:54 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id EC6FCB23E48 for ; Wed, 24 Jul 2024 19:06:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0C233161327; Wed, 24 Jul 2024 19:06:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RfjekoAj" X-Original-To: linux-ext4@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BACCF15667B; Wed, 24 Jul 2024 19:06:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721848007; cv=none; b=JQxgfwgArx0rM1hhMfr/TikujpZJ2sxBS80I1XIb3dnT0dnHR2jNw7ZjVj9yt0pIVcz92/H4mYT7x0PuVW1pFJZMn6xHUEL7NgrWYeVXouDnXY3Q8cL7wbaQTv8sab0BG0+heeZhc2XMYcnOLVLQlKaayQrt4z4wV++nyP13+EQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721848007; c=relaxed/simple; bh=WK5BPW1X67NRzibaJjSAvchBzJPiuxvCRkJVAJwag6k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pSSSQE84GZdLTeByEKtjdhdb78HyIdmoSFmNqMMaAktVTtchZuKUgWHJ6k9c2NjkEQzt390doThDSyfdYVuWfriPqAZMALYu5YW0kPNwCacxJJigYb1oTxXpq0cOLfzpWtHPZf04gfmasGMquBf5gnNRDnt0IhfJFnrR8UZ4Vk0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RfjekoAj; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 51876C32781; Wed, 24 Jul 2024 19:06:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721848007; bh=WK5BPW1X67NRzibaJjSAvchBzJPiuxvCRkJVAJwag6k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RfjekoAjsxQJmS0ozU0AJolZSMEYp4Xz3On/ZcU3nTHIrwLKrRQXsCrAwYMOew8sx bO9y9rTLSSGI7F1tAS0Da63Bw1BiPDwooS5CSDg0TmUaoOW5aHWVEgoXDFGaXOUEib yR7jM5F+Ma+J3WYCUAZR/sXzr6pOd9ym6c7QM75Uc2okaQsMFGebPy+VOMmRnc/Rgo h2VjwZTQG0B/fUMVgU+8gnhQQSY8PwomtOxqCMknYd5NKs7D4nBDROKpgmoMSl81bi BW82LP5SQRI2wceMzYG7dgMA80WUc9b1jXmTekkY1PG+4xs/MC9w5tVC0i1iWnu1+r IYxzm+X6xVnRQ== From: cel@kernel.org To: amir73il@gmail.com, krisman@collabora.com Cc: gregkh@linuxfoundation.org, jack@suse.cz, sashal@kernel.org, stable@vger.kernel.org, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, tytso@mit.edu, alexey.makhalov@broadcom.com, vasavi.sirnapalli@broadcom.com, florian.fainelli@broadcom.com Subject: [PATCH v5.15.y 1/4] samples: Add fs error monitoring example Date: Wed, 24 Jul 2024 15:06:20 -0400 Message-ID: <20240724190623.8948-2-cel@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240724190623.8948-1-cel@kernel.org> References: <20240724190623.8948-1-cel@kernel.org> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Gabriel Krisman Bertazi [ Upstream commit 5451093081db6ca1a708d149e11cfd219800bc4c ] Introduce an example of a FAN_FS_ERROR fanotify user to track filesystem errors. Link: https://lore.kernel.org/r/20211025192746.66445-31-krisman@collabora.com Reviewed-by: Amir Goldstein Reviewed-by: Jan Kara Signed-off-by: Gabriel Krisman Bertazi Signed-off-by: Jan Kara Signed-off-by: Chuck Lever --- samples/Kconfig | 9 +++ samples/Makefile | 1 + samples/fanotify/Makefile | 5 ++ samples/fanotify/fs-monitor.c | 142 ++++++++++++++++++++++++++++++++++ 4 files changed, 157 insertions(+) create mode 100644 samples/fanotify/Makefile create mode 100644 samples/fanotify/fs-monitor.c diff --git a/samples/Kconfig b/samples/Kconfig index b0503ef058d3..88353b8eac0b 100644 --- a/samples/Kconfig +++ b/samples/Kconfig @@ -120,6 +120,15 @@ config SAMPLE_CONNECTOR with it. See also Documentation/driver-api/connector.rst +config SAMPLE_FANOTIFY_ERROR + bool "Build fanotify error monitoring sample" + depends on FANOTIFY + help + When enabled, this builds an example code that uses the + FAN_FS_ERROR fanotify mechanism to monitor filesystem + errors. + See also Documentation/admin-guide/filesystem-monitoring.rst. + config SAMPLE_HIDRAW bool "hidraw sample" depends on CC_CAN_LINK && HEADERS_INSTALL diff --git a/samples/Makefile b/samples/Makefile index 087e0988ccc5..931a81847c48 100644 --- a/samples/Makefile +++ b/samples/Makefile @@ -5,6 +5,7 @@ subdir-$(CONFIG_SAMPLE_AUXDISPLAY) += auxdisplay subdir-$(CONFIG_SAMPLE_ANDROID_BINDERFS) += binderfs obj-$(CONFIG_SAMPLE_CONFIGFS) += configfs/ obj-$(CONFIG_SAMPLE_CONNECTOR) += connector/ +obj-$(CONFIG_SAMPLE_FANOTIFY_ERROR) += fanotify/ subdir-$(CONFIG_SAMPLE_HIDRAW) += hidraw obj-$(CONFIG_SAMPLE_HW_BREAKPOINT) += hw_breakpoint/ obj-$(CONFIG_SAMPLE_KDB) += kdb/ diff --git a/samples/fanotify/Makefile b/samples/fanotify/Makefile new file mode 100644 index 000000000000..e20db1bdde3b --- /dev/null +++ b/samples/fanotify/Makefile @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-only +userprogs-always-y += fs-monitor + +userccflags += -I usr/include -Wall + diff --git a/samples/fanotify/fs-monitor.c b/samples/fanotify/fs-monitor.c new file mode 100644 index 000000000000..a0e44cd31e6f --- /dev/null +++ b/samples/fanotify/fs-monitor.c @@ -0,0 +1,142 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright 2021, Collabora Ltd. + */ + +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef FAN_FS_ERROR +#define FAN_FS_ERROR 0x00008000 +#define FAN_EVENT_INFO_TYPE_ERROR 5 + +struct fanotify_event_info_error { + struct fanotify_event_info_header hdr; + __s32 error; + __u32 error_count; +}; +#endif + +#ifndef FILEID_INO32_GEN +#define FILEID_INO32_GEN 1 +#endif + +#ifndef FILEID_INVALID +#define FILEID_INVALID 0xff +#endif + +static void print_fh(struct file_handle *fh) +{ + int i; + uint32_t *h = (uint32_t *) fh->f_handle; + + printf("\tfh: "); + for (i = 0; i < fh->handle_bytes; i++) + printf("%hhx", fh->f_handle[i]); + printf("\n"); + + printf("\tdecoded fh: "); + if (fh->handle_type == FILEID_INO32_GEN) + printf("inode=%u gen=%u\n", h[0], h[1]); + else if (fh->handle_type == FILEID_INVALID && !fh->handle_bytes) + printf("Type %d (Superblock error)\n", fh->handle_type); + else + printf("Type %d (Unknown)\n", fh->handle_type); + +} + +static void handle_notifications(char *buffer, int len) +{ + struct fanotify_event_metadata *event = + (struct fanotify_event_metadata *) buffer; + struct fanotify_event_info_header *info; + struct fanotify_event_info_error *err; + struct fanotify_event_info_fid *fid; + int off; + + for (; FAN_EVENT_OK(event, len); event = FAN_EVENT_NEXT(event, len)) { + + if (event->mask != FAN_FS_ERROR) { + printf("unexpected FAN MARK: %llx\n", event->mask); + goto next_event; + } + + if (event->fd != FAN_NOFD) { + printf("Unexpected fd (!= FAN_NOFD)\n"); + goto next_event; + } + + printf("FAN_FS_ERROR (len=%d)\n", event->event_len); + + for (off = sizeof(*event) ; off < event->event_len; + off += info->len) { + info = (struct fanotify_event_info_header *) + ((char *) event + off); + + switch (info->info_type) { + case FAN_EVENT_INFO_TYPE_ERROR: + err = (struct fanotify_event_info_error *) info; + + printf("\tGeneric Error Record: len=%d\n", + err->hdr.len); + printf("\terror: %d\n", err->error); + printf("\terror_count: %d\n", err->error_count); + break; + + case FAN_EVENT_INFO_TYPE_FID: + fid = (struct fanotify_event_info_fid *) info; + + printf("\tfsid: %x%x\n", + fid->fsid.val[0], fid->fsid.val[1]); + print_fh((struct file_handle *) &fid->handle); + break; + + default: + printf("\tUnknown info type=%d len=%d:\n", + info->info_type, info->len); + } + } +next_event: + printf("---\n\n"); + } +} + +int main(int argc, char **argv) +{ + int fd; + + char buffer[BUFSIZ]; + + if (argc < 2) { + printf("Missing path argument\n"); + return 1; + } + + fd = fanotify_init(FAN_CLASS_NOTIF|FAN_REPORT_FID, O_RDONLY); + if (fd < 0) + errx(1, "fanotify_init"); + + if (fanotify_mark(fd, FAN_MARK_ADD|FAN_MARK_FILESYSTEM, + FAN_FS_ERROR, AT_FDCWD, argv[1])) { + errx(1, "fanotify_mark"); + } + + while (1) { + int n = read(fd, buffer, BUFSIZ); + + if (n < 0) + errx(1, "read"); + + handle_notifications(buffer, n); + } + + return 0; +} From patchwork Wed Jul 24 19:06:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 1964465 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=c5KnN2sg; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org (client-ip=2404:9400:2221:ea00::3; helo=mail.ozlabs.org; envelope-from=srs0=jjx9=oy=vger.kernel.org=linux-ext4+bounces-3434-patchwork-incoming=ozlabs.org@ozlabs.org; receiver=patchwork.ozlabs.org) Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WTk614jDpz1yZw for ; Thu, 25 Jul 2024 05:07:05 +1000 (AEST) Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4WTk612M6Wz4w2K for ; Thu, 25 Jul 2024 05:07:05 +1000 (AEST) Received: by gandalf.ozlabs.org (Postfix) id 4WTk612J0xz4wnx; Thu, 25 Jul 2024 05:07:05 +1000 (AEST) Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: gandalf.ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: gandalf.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=c5KnN2sg; dkim-atps=neutral Authentication-Results: gandalf.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:4601:e00::3; helo=am.mirrors.kernel.org; envelope-from=linux-ext4+bounces-3434-patchwork-incoming=ozlabs.org@vger.kernel.org; receiver=ozlabs.org) Received: from am.mirrors.kernel.org (am.mirrors.kernel.org [IPv6:2604:1380:4601:e00::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by gandalf.ozlabs.org (Postfix) with ESMTPS id 4WTk605pxcz4w2K for ; Thu, 25 Jul 2024 05:07:04 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B522C1F2190B for ; Wed, 24 Jul 2024 19:07:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2A4A115F403; Wed, 24 Jul 2024 19:06:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="c5KnN2sg" X-Original-To: linux-ext4@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DB3FF65E20; Wed, 24 Jul 2024 19:06:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721848017; cv=none; b=mZGv3mem2qHQKee4JbSneedvGyyQ2RRtBhpU9+R9pt/AJdGkuqyrk6QkrKiPqoyz+Yt9g5hv0PTyu61GKycXAOTAObM6ZQIxR+lGYFNgrHc2m5gyLm1tk2mbklMzFIt5mtS0SVRZYCop6c3AVCd5Vjfy1wXzxk//wSIJ1y/isd0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721848017; c=relaxed/simple; bh=rQ153ztKslahUTw3Zcbb4iyRxvj1/+V/XI2lxHnMeO8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=c/vrQta7jjNKwkW2OwqzBQmlYwUxYsw46G08+hK3YalozX91iiIw0kaHhLsVwBqvdMpAQW6bN+yCdE3Ol01w0ASBDZXnxlljotfS8dX/h8jWgA2rrJ+noeyg0OGSbc3r4shCEqEJ9jINYF5DnsGJW0+K0YGm4kENmcV9dQ4KCw0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=c5KnN2sg; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9403CC32781; Wed, 24 Jul 2024 19:06:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721848016; bh=rQ153ztKslahUTw3Zcbb4iyRxvj1/+V/XI2lxHnMeO8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c5KnN2sgsF4sbsIF+PtbhCS+EooYiZ5qKTfBqCua8GlKrWWG51YCbiIpPXRaNMe4Y WXtzM8PSyhgttSQT5HJHtYrutMxG+wUGhM0tvBfYtFw42oX+8UwNDS3CF7I1yK7G8p +T0ZqvBwLm9XuqsFKj9OVV2U/m9rlx0PkSCOybHJpC+sIBTuBZzm6n380q8FyJqIiE 9ovSRLsxU4RVyn+oWLcF/Eq3xxKcxjN33zY/FJ13/e/L7bj8G5TM51q0fqPHPZLHdO AjaoCVIby43VM1raZOjgjd8qXDIb+8OiOoZY8PnPe8Z0yV536/rC1CGzEHLX7nCr5S hgvVv1Q/+zBMQ== From: cel@kernel.org To: amir73il@gmail.com, krisman@collabora.com Cc: gregkh@linuxfoundation.org, jack@suse.cz, sashal@kernel.org, stable@vger.kernel.org, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, tytso@mit.edu, alexey.makhalov@broadcom.com, vasavi.sirnapalli@broadcom.com, florian.fainelli@broadcom.com, Guenter Roeck Subject: [PATCH v5.15.y 2/4] samples: Make fs-monitor depend on libc and headers Date: Wed, 24 Jul 2024 15:06:21 -0400 Message-ID: <20240724190623.8948-3-cel@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240724190623.8948-1-cel@kernel.org> References: <20240724190623.8948-1-cel@kernel.org> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Gabriel Krisman Bertazi [ Upstream commit 8fc70b3a142f97f7859bf052151df896933d2586 ] Prevent build errors when headers or libc are not available, such as on kernel build bots, like the below: samples/fanotify/fs-monitor.c:7:10: fatal error: errno.h: No such file or directory 7 | #include | ^~~~~~~~~ Link: https://lore.kernel.org/r/87fsslasgz.fsf@collabora.com Suggested-by: Guenter Roeck Tested-by: Guenter Roeck Signed-off-by: Gabriel Krisman Bertazi Signed-off-by: Jan Kara Signed-off-by: Chuck Lever --- samples/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/Kconfig b/samples/Kconfig index 88353b8eac0b..56539b21f2c7 100644 --- a/samples/Kconfig +++ b/samples/Kconfig @@ -122,7 +122,7 @@ config SAMPLE_CONNECTOR config SAMPLE_FANOTIFY_ERROR bool "Build fanotify error monitoring sample" - depends on FANOTIFY + depends on FANOTIFY && CC_CAN_LINK && HEADERS_INSTALL help When enabled, this builds an example code that uses the FAN_FS_ERROR fanotify mechanism to monitor filesystem From patchwork Wed Jul 24 19:06:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 1964466 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=T8u86VRb; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org (client-ip=2404:9400:2221:ea00::3; helo=mail.ozlabs.org; envelope-from=srs0=dj2y=oy=vger.kernel.org=linux-ext4+bounces-3435-patchwork-incoming=ozlabs.org@ozlabs.org; receiver=patchwork.ozlabs.org) Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WTk6B2Mz7z1yZw for ; Thu, 25 Jul 2024 05:07:14 +1000 (AEST) Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4WTk6B1wCmz4w2K for ; Thu, 25 Jul 2024 05:07:14 +1000 (AEST) Received: by gandalf.ozlabs.org (Postfix) id 4WTk6B1t20z4wnt; Thu, 25 Jul 2024 05:07:14 +1000 (AEST) Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: gandalf.ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: gandalf.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=T8u86VRb; dkim-atps=neutral Authentication-Results: gandalf.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=147.75.80.249; helo=am.mirrors.kernel.org; envelope-from=linux-ext4+bounces-3435-patchwork-incoming=ozlabs.org@vger.kernel.org; receiver=ozlabs.org) Received: from am.mirrors.kernel.org (am.mirrors.kernel.org [147.75.80.249]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by gandalf.ozlabs.org (Postfix) with ESMTPS id 4WTk6951mGz4w2K for ; Thu, 25 Jul 2024 05:07:13 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 69A391F21CA9 for ; Wed, 24 Jul 2024 19:07:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9353116078E; Wed, 24 Jul 2024 19:07:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="T8u86VRb" X-Original-To: linux-ext4@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4EEBC65E20; Wed, 24 Jul 2024 19:07:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721848025; cv=none; b=Rjq2PDuG/rhEy0W2DoVRr1MG6FKcHwYwEyCP8ZxaGYYbKS8kyJKsYi4NSzdrgoAp8E4l6EIUAbgZFC+uYwWOK9OfzNaET9ty3Kh+W+jVuV2JLoiM919wVYdH6RoF711h7jpHFI0r2dPrkuPeldwiUCv8v0H12Ue4+8AAFtlXJUA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721848025; c=relaxed/simple; bh=iphHr0EX7lolNkzQUwFnzeU1+uuZ9oEjhGKPWWI4urs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=m5sAcCxJ35OlKi9xCBSsHFzwAkC0Rq+kWnbdB9l6kiU8z8VdhCIGmkZQtgp7HNw08kvA2JRJrnVsWYmzbLnG0AbqWI6+1cFuEJwninddWtkpMnLt1Su1rVJ2ATQAR6EqucVG8Ze3kVQrs1sHpaXDdoaINxxNYw0WPC6xOEKzna4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=T8u86VRb; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A6ADCC32781; Wed, 24 Jul 2024 19:07:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721848024; bh=iphHr0EX7lolNkzQUwFnzeU1+uuZ9oEjhGKPWWI4urs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T8u86VRbowcjTD6LPdW03OXUi9ddvRyoDNDqe1X6HujEaXYOasaXHFGghPQPoGaL1 nHnNqt/wG7ePf8YpJkUSNoMC1JA9tdukxO76x+QGoUDfZAw3fFXAXXiFeTdrpxjf4n a2QL8If1FKCN2PMIL+zsY6E5pEU05b8UVUv5crrUKu2B2uTEa7M479yJlxFqhoLf36 BRqo+uCEcsm7+H+g9aNfYFPax5yl/z4F7ScsSnnGk87PwZpqyNHHaY1Ep1nDsjTl1k lGjVX1UQoPAvgjWusX5qMkqn6kwLzuZ2fKZKLGB/s0g2RkPnnfQfAm3UxzJXypUuv0 mBtvh4JCjQN9A== From: cel@kernel.org To: amir73il@gmail.com, krisman@collabora.com Cc: gregkh@linuxfoundation.org, jack@suse.cz, sashal@kernel.org, stable@vger.kernel.org, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, tytso@mit.edu, alexey.makhalov@broadcom.com, vasavi.sirnapalli@broadcom.com, florian.fainelli@broadcom.com, Stephen Rothwell Subject: [PATCH v5.15.y 3/4] docs: Fix formatting of literal sections in fanotify docs Date: Wed, 24 Jul 2024 15:06:22 -0400 Message-ID: <20240724190623.8948-4-cel@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240724190623.8948-1-cel@kernel.org> References: <20240724190623.8948-1-cel@kernel.org> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Gabriel Krisman Bertazi [ Upstream commit 9abeae5d4458326e16df7ea237104b58c27dfd77 ] Stephen Rothwell reported the following warning was introduced by commit c0baf9ac0b05 ("docs: Document the FAN_FS_ERROR event"). Documentation/admin-guide/filesystem-monitoring.rst:60: WARNING: Definition list ends without a blank line; unexpected unindent. Link: https://lore.kernel.org/r/87y26camhe.fsf@collabora.com Reported-by: Stephen Rothwell Signed-off-by: Gabriel Krisman Bertazi Signed-off-by: Jan Kara Signed-off-by: Chuck Lever --- .../admin-guide/filesystem-monitoring.rst | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/Documentation/admin-guide/filesystem-monitoring.rst b/Documentation/admin-guide/filesystem-monitoring.rst index 5a3c84e60095..ab8dba76283c 100644 --- a/Documentation/admin-guide/filesystem-monitoring.rst +++ b/Documentation/admin-guide/filesystem-monitoring.rst @@ -35,9 +35,11 @@ notifications is Ext4. A FAN_FS_ERROR Notification has the following format:: - [ Notification Metadata (Mandatory) ] - [ Generic Error Record (Mandatory) ] - [ FID record (Mandatory) ] + :: + + [ Notification Metadata (Mandatory) ] + [ Generic Error Record (Mandatory) ] + [ FID record (Mandatory) ] 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 @@ -53,11 +55,13 @@ 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. - struct fanotify_event_info_error { - struct fanotify_event_info_header hdr; - __s32 error; - __u32 error_count; - }; + :: + + struct fanotify_event_info_error { + struct fanotify_event_info_header hdr; + __s32 error; + __u32 error_count; + }; The `error` field identifies the type of error using errno values. `error_count` tracks the number of errors that occurred and were From patchwork Wed Jul 24 19:06:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 1964467 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=HDOhogHA; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org (client-ip=2404:9400:2221:ea00::3; helo=mail.ozlabs.org; envelope-from=srs0=f8de=oy=vger.kernel.org=linux-ext4+bounces-3436-patchwork-incoming=ozlabs.org@ozlabs.org; receiver=patchwork.ozlabs.org) Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WTk6C5Gq7z1yZw for ; Thu, 25 Jul 2024 05:07:15 +1000 (AEST) Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4WTk6C4qywz4wnt for ; Thu, 25 Jul 2024 05:07:15 +1000 (AEST) Received: by gandalf.ozlabs.org (Postfix) id 4WTk6C4mj9z4wnx; Thu, 25 Jul 2024 05:07:15 +1000 (AEST) Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: gandalf.ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: gandalf.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=HDOhogHA; dkim-atps=neutral Authentication-Results: gandalf.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:40f1:3f00::1; helo=sy.mirrors.kernel.org; envelope-from=linux-ext4+bounces-3436-patchwork-incoming=ozlabs.org@vger.kernel.org; receiver=ozlabs.org) Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org [IPv6:2604:1380:40f1:3f00::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by gandalf.ozlabs.org (Postfix) with ESMTPS id 4WTk6C4gj2z4wnt for ; Thu, 25 Jul 2024 05:07:15 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 1FE02B219B7 for ; Wed, 24 Jul 2024 19:07:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8A07E16078E; Wed, 24 Jul 2024 19:07:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HDOhogHA" X-Original-To: linux-ext4@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3F4D315667B; Wed, 24 Jul 2024 19:07:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721848032; cv=none; b=RmYy7z8r8WeiAjtZ96gRyVh8hqLhTs7R82Jy9h1D4zvU5D6fgLHNjG4maYUIrBWdAZzP0Yw10kvZKyRdxscTsZE3onMwzRh7dQQGba0O2awz2q4O9aomYRbC6lOmo424IE+AqvFdBq+X3up/00r9vAofEgHVFCiKkWoigfpbwXc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721848032; c=relaxed/simple; bh=KuUPeMyDvwC7MuSmAeXi/1iMqP7uEsayTyngz5IKoIs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PNJLzb20KsqUd/0ZW+Ou8bRcLpr5wTnJBPkHqDyAeS4AixHk0enLdQLklbdkvrS4v6YpCYqdlg6btB9mhupLqzRfb3p5Tj/uLe1Ehbu6S7zpAhF1lmJ0hoGDBEUYtFa0vAaX0pVTx9psPHlgMmjKUeztbxU7ovXD9wjG30gnzD4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HDOhogHA; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id F3B13C32781; Wed, 24 Jul 2024 19:07:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721848032; bh=KuUPeMyDvwC7MuSmAeXi/1iMqP7uEsayTyngz5IKoIs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HDOhogHAl9egr+v/I6d5wMOJp80fa4Vv451537jEgr4G/XyrOabLvVqD9PRWipMKJ tYEt0B4c5frX5jdk3xklrkjI9sXuf8YpJYq2QBOQfS+AaOh+qTjNISJRsrt6lnc216 /QeOUG8IS/X1P7u+SY6ddXQDAMcKMc/R9GWxZfVXRvpwHxWZx5OWjd5todDYA+nNXE sjF/M4rX7Pxq9ihgmyG0ko5oKTwQkieFwGeK5UpX+K3tQtacbBg8jtOFHYwsH5WMG2 jLNIT1eEzS8K8A2t5LlSCGMhA6ZPMhKNxKvXSrututDBlDNJON71xbO+PcItcG3o9/ UR+Jp5ATQlTuA== From: cel@kernel.org To: amir73il@gmail.com, krisman@collabora.com Cc: gregkh@linuxfoundation.org, jack@suse.cz, sashal@kernel.org, stable@vger.kernel.org, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, tytso@mit.edu, alexey.makhalov@broadcom.com, vasavi.sirnapalli@broadcom.com, florian.fainelli@broadcom.com, Linus Torvalds Subject: [PATCH v5.15.y 4/4] Add gitignore file for samples/fanotify/ subdirectory Date: Wed, 24 Jul 2024 15:06:23 -0400 Message-ID: <20240724190623.8948-5-cel@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240724190623.8948-1-cel@kernel.org> References: <20240724190623.8948-1-cel@kernel.org> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Linus Torvalds [ Upstream commit c107fb9b4f8338375b3e865c3d2c1d98ccb3a95a ] Commit 5451093081db ("samples: Add fs error monitoring example") added a new sample program, but didn't teach git to ignore the new generated files, causing unnecessary noise from 'git status' after a full build. Add the 'fs-monitor' sample executable to the .gitignore for this subdirectory to silence it all again. Signed-off-by: Linus Torvalds Signed-off-by: Chuck Lever --- samples/fanotify/.gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 samples/fanotify/.gitignore diff --git a/samples/fanotify/.gitignore b/samples/fanotify/.gitignore new file mode 100644 index 000000000000..d74593e8b2de --- /dev/null +++ b/samples/fanotify/.gitignore @@ -0,0 +1 @@ +fs-monitor