Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1886955pxb; Thu, 28 Oct 2021 11:57:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8iaZl8rhrSZpR4Hya3sn+YBfV3iHT4sfwDpp1y7lmaO9vr2w+yfVq3YCTV3SgAJqc9YVi X-Received: by 2002:a17:90b:1a84:: with SMTP id ng4mr6498806pjb.80.1635447430103; Thu, 28 Oct 2021 11:57:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635447430; cv=none; d=google.com; s=arc-20160816; b=QaVlYTkON/D+oG41y9cUiMhQ9e1o8e8AwkN2ZgOqviquzeYcjipmp6f0AXh5Lx2eRT fC9cPsw6lymOnR0sFWxnMQXhy5R+58OrFLp481z9G+KsoU91m8KQTAgnTg2CqCZMvuxu lUNKSeFMt2Tg9HW3xhwIPvMsdPO9SYbS6d9MclPXYL3Bz3i8OmtAHL6gLiYUnS89xhMr 8r4VRkXdWzRn/sQ2oSIAtfBt7oMcos0QEqme+60El78SaI5xpgodbPz609yYXPIteBUn N+uTAxfd4Rtjg5JXV/2rn8A5ooWtOHmvX9HqPPtWbfSV7SGz0Dc7lPghWkhKR+DIHXDg BbuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:organization:subject:cc:to:from; bh=GZlf4RWPcpPfEqprydr/y6EhvRJjSWOOrIQTXZyiaFo=; b=X9zYJDsIpUBjmLgQeSQnSX5oWI8Z5AiSdA07W0Thcfa+/gqsiOZXS4Q4dwIIpzVTRU hid3ElVS/bLMeHldIaWQr2XXyz1WxqEzJNSWp/fyo7oJUUYEJWO2ZMXjG9CeYqHEVcBC g+FiRhf7lnChQi94XGe+BDnBrJc+HIEYht14r2uRvbg4vyidCPzaOviUFAPdpQn44Q/O nygkoA5klz4VFQ2cFr2l3BKXar+vVB8u9fzasG10APQfas8egoVmuR6VytGIz2DhlRHs E8MyxbB8eeT6HjwBLMqLg5rZ23btA5G6gDUy5n1JHcdgPKmgpQqGj3qzo8Au3FXN5f0D etXw== 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 i188si4221118pfb.206.2021.10.28.11.56.40; Thu, 28 Oct 2021 11:57:10 -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 S230444AbhJ1S7F (ORCPT + 99 others); Thu, 28 Oct 2021 14:59:05 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:45368 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229645AbhJ1S7F (ORCPT ); Thu, 28 Oct 2021 14:59:05 -0400 Received: from localhost (unknown [IPv6:2804:14c:124:8a08::1002]) (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 083D11F454BA; Thu, 28 Oct 2021 19:56:35 +0100 (BST) From: Gabriel Krisman Bertazi To: Guenter Roeck Cc: jack@suse.com, amir73il@gmail.com, 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, kernel@collabora.com Subject: Re: [PATCH v8 31/32] samples: Add fs error monitoring example Organization: Collabora References: <20211019000015.1666608-1-krisman@collabora.com> <20211019000015.1666608-32-krisman@collabora.com> <20211028151834.GA423440@roeck-us.net> Date: Thu, 28 Oct 2021 15:56:28 -0300 In-Reply-To: <20211028151834.GA423440@roeck-us.net> (Guenter Roeck's message of "Thu, 28 Oct 2021 08:18:34 -0700") Message-ID: <87fsslasgz.fsf@collabora.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Guenter Roeck writes: > On Mon, Oct 18, 2021 at 09:00:14PM -0300, Gabriel Krisman Bertazi wrote: >> Introduce an example of a FAN_FS_ERROR fanotify user to track filesystem >> errors. >> >> Reviewed-by: Amir Goldstein >> Signed-off-by: Gabriel Krisman Bertazi >> Reviewed-by: Jan Kara >> --- >> Changes since v4: >> - Protect file_handle defines with ifdef guards >> >> Changes since v1: >> - minor fixes >> --- >> 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 > > This needs something like > depends on CC_CAN_LINK > or possibly even > depends on CC_CAN_LINK && HEADERS_INSTALL > to avoid compilation errors such as > > samples/fanotify/fs-monitor.c:7:10: fatal error: errno.h: No such file or directory > 7 | #include > | ^~~~~~~~~ > compilation terminated. > > when using a toolchain without C library support, such as those provided > on kernel.org. Thank you, Guenter. We discussed this, but I wasn't sure how to silence the error and it didn't trigger in the past versions. The original patch is already in Jan's tree. Jan, would you pick the pack below to address it? Feel free to squash it into the original commit, if you think it is saner.. Thanks, -- >8 -- From: Gabriel Krisman Bertazi Date: Thu, 28 Oct 2021 15:34:46 -0300 Subject: [PATCH] samples: Make fs-monitor depend on libc and headers 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 | ^~~~~~~~~ Suggested-by: Guenter Roeck Signed-off-by: Gabriel Krisman Bertazi --- 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 -- 2.33.0