Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2923096pxb; Mon, 1 Nov 2021 04:43:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUUGPAUqPB4XTJpFgmFbiZc9zIpeuKm4akGOohyXuEB1D3ByT9GZzmUl/CZasn3vCqlnM8 X-Received: by 2002:a17:906:369a:: with SMTP id a26mr34865768ejc.539.1635766994798; Mon, 01 Nov 2021 04:43:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635766994; cv=none; d=google.com; s=arc-20160816; b=cQtGqMk6o9gWN7MWB2HSOUGoQlAv4HE7rx3vfUSdOmmej9nSyxq6a9p5rbVdnTTObb 5DLnvdNxviuGxSEK1u5SnPoRgXOrVWXTt923uX14rrZtvRcKZHXqpxfVI2rLKWk5sw9M h/4d1nPMDel3b4vPmeDFoFv7z3Ii/hGohYbkeKrsLEat8DOkkc2tWRVtTMJ5Z17aBY/p oMywxQupZIEoaZ714lqS5fRc2J1AFucwEwvxhdTPWLqoU1gbzONQp4H8NmCLgr7hTV1U ocEzvsieHsnp/VKnKsZVj8f8xpEn0/MLo7f7u63wHb+HHBzTl2NrjfB5aiuY7NWsfj/E 4kmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=5+UZ2j8LT45fgqOAv0Vr6ez6FSL6G50V8K6dC/keqBw=; b=z483Xo1+Bga7PqEuAsenBevzotXIKWku0A76ZzDkzLWDUuCQJJycROK3iX5SjQwk1p 4LCZEpzJ8LL3UP1C4Rdpoel0jWfDpmdpOFmPWI2jpHfcJLAtvsusAw4LJFy2+o0D2xMh E/PDmseh4/1Eqzgq/j5iYjXzv751ZiS5VXkCv3H3WCaox1pImtVcTzRL0Zjgz1qrpaYQ oEcwNnB1QwTUg8CNRwO6s/AuS7alUwfzFNwBcybEHaF+3GIZyhxVc6Vfx7JIyq0sWawq wPlfDAzVs2SXJO4Eb7pEWtRKLkNPVA0JNhgDJ2oxM30zb3jGoYsAvHDGg0776lbvD9Q4 8kng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=TpxQF6Xk; dkim=neutral (no key) header.i=@suse.cz header.b=VcmHWF5B; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l22si9480543edq.380.2021.11.01.04.42.39; Mon, 01 Nov 2021 04:43:14 -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=@suse.cz header.s=susede2_rsa header.b=TpxQF6Xk; dkim=neutral (no key) header.i=@suse.cz header.b=VcmHWF5B; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232308AbhKALpA (ORCPT + 99 others); Mon, 1 Nov 2021 07:45:00 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:43496 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232365AbhKALo5 (ORCPT ); Mon, 1 Nov 2021 07:44:57 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 487171FD6F; Mon, 1 Nov 2021 11:42:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1635766943; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=5+UZ2j8LT45fgqOAv0Vr6ez6FSL6G50V8K6dC/keqBw=; b=TpxQF6XkaQ4sHXFLHRKTujdwKdEcQ3Wxqz7N2HhNThXxseVCuEiHp/GrSyujTn3z92eWSl brvTK7RPJ7Xy2uvk0OCSjQK5b08Qgfptl+vYiz2luwB2noLA0pde8QTx3Zo1IMAhFhxSP5 a+7SnrlVcp9uVdLb9Q6fDXrA1IM8a1Q= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1635766943; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=5+UZ2j8LT45fgqOAv0Vr6ez6FSL6G50V8K6dC/keqBw=; b=VcmHWF5BTXOtCHI147RmuzHfL1k+o+u55tYqmccO0oz5vdCGgnb/5ZDnos6+N/oy+b+Sh5 75W1t868sxM6+bAQ== Received: from quack2.suse.cz (unknown [10.163.28.18]) by relay2.suse.de (Postfix) with ESMTP id 0709AA3B81; Mon, 1 Nov 2021 11:42:22 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id CD7281E0922; Mon, 1 Nov 2021 12:42:22 +0100 (CET) Date: Mon, 1 Nov 2021 12:42:22 +0100 From: Jan Kara To: Gabriel Krisman Bertazi Cc: Guenter Roeck , 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 Message-ID: <20211101114222.GA21679@quack2.suse.cz> References: <20211019000015.1666608-1-krisman@collabora.com> <20211019000015.1666608-32-krisman@collabora.com> <20211028151834.GA423440@roeck-us.net> <87fsslasgz.fsf@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87fsslasgz.fsf@collabora.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu 28-10-21 15:56:28, Gabriel Krisman Bertazi wrote: > 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 guys, I've added the patch to my tree. If we had more time, I'd probably squash it but given I'd like to send Linus a pull request at the end of the week I don't want to touch commits that are already in next. Honza > -- >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 > -- Jan Kara SUSE Labs, CR