Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp5869148pxv; Wed, 7 Jul 2021 13:44:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySbl5INmuQFE0cSnW16MMyg2IC+i9nmAtgM6C7SATfhkl68Wg746A/GEMD7/JzDeoDmplu X-Received: by 2002:a5d:8511:: with SMTP id q17mr21908942ion.98.1625690642183; Wed, 07 Jul 2021 13:44:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625690642; cv=none; d=google.com; s=arc-20160816; b=Ne3OvIk86K0Osng1arkVIs2zV1AI6mgzgg4Dd08IMvgSJ147Iy7bIhRvlMQbK9QAZ8 Q4pxj75okiC4K5cmyIdW3Ol4ATdn5eOg+EIcq8ITtRtrfd2asSVBrbL9WYrZwLRsOhvS sXzVT/qSPRK97YAg3UzmSmaxWE+Qe86sI4YRrtjpiCnYFDa72MngYso+dO0B4T/aZLFF +GXEz/G5VgEOEvO/ED0ER4h32b5GtbjVhSXeVSkLJLbndhCeqnZjK8W42wd5WqT9dBB8 84kfm/SwpQONweC8dOdO3gx/PzTM5UdTwJDgck+Qfo3gKZKHeOIQ8V3y0xfH/mfWgFLo RB7A== 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=G16r5ZzCDpmdwpyxd+WXlKLidqUdLoyo9jFAMAqRQFQ=; b=J0Y9IlpRI6mfMJsf8Vux0MzESYZxcPB5TX2+PwIGi2lfbDWJHSZEUb86kXOp3VAHEe m6nTV4zJlf4r4ch70LljzHEiiUpnY6cPG/LOysT7puKXsBedowifSQN3cW1HGyS+MGh5 oNjTQbXfPniMJh8Nlm+gATaBadXl2Z8xbNcQZYlqdRp8QT70aZxloIBfcNfx94/80ETB 2+rH4aFJcyTBAYZugiYY1zz08+G0JkxEBD0IPuyE2029logr3ZMPcgMTui7OBJk3Z8fk flEVIDixkvKSe6PyY0JgopHMWt8jPta9ZTZ2zD0SuwugOcMfHdm3uUBE23v/AGcbIOFH sGag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=gKNBEqlH; dkim=neutral (no key) header.i=@suse.cz; 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 v9si179252ilu.9.2021.07.07.13.43.50; Wed, 07 Jul 2021 13:44:02 -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=gKNBEqlH; dkim=neutral (no key) header.i=@suse.cz; 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 S232566AbhGGUQt (ORCPT + 99 others); Wed, 7 Jul 2021 16:16:49 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:57426 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230296AbhGGUQt (ORCPT ); Wed, 7 Jul 2021 16:16:49 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id C745F20100; Wed, 7 Jul 2021 20:14:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1625688847; 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=G16r5ZzCDpmdwpyxd+WXlKLidqUdLoyo9jFAMAqRQFQ=; b=gKNBEqlHQFaExTrToE1vaGOxpfUIqwsUV03KcqTOIqybBT645xt7ee4LBPsbVMnSKfDxP2 cy5cy3ux7QQim2kZz1ojLrWuWnIVAn6850QC67lYGpfMEtM87P0F6q4wGoxAwcOQiP//S7 jbrxPYLRSmkCie1YDDhZjhOYrJYcvgk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1625688847; 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=G16r5ZzCDpmdwpyxd+WXlKLidqUdLoyo9jFAMAqRQFQ=; b=/yhtbtVaVZF3EgWxabFWzavGzuS7TGqGNBxnlvSPtbo1iPwMAV55Oy5IprmLds0TCYAHx/ 9Rkjuktn0TY4tdBw== Received: from quack2.suse.cz (unknown [10.163.43.118]) by relay2.suse.de (Postfix) with ESMTP id B420CA3B87; Wed, 7 Jul 2021 20:14:07 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 97E131F2CD7; Wed, 7 Jul 2021 22:14:07 +0200 (CEST) Date: Wed, 7 Jul 2021 22:14:07 +0200 From: Jan Kara To: Gabriel Krisman Bertazi Cc: amir73il@gmail.com, djwong@kernel.org, tytso@mit.edu, david@fromorbit.com, jack@suse.com, dhowells@redhat.com, khazhy@google.com, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, kernel@collabora.com Subject: Re: [PATCH v3 06/15] fsnotify: Add helper to detect overflow_event Message-ID: <20210707201407.GH18396@quack2.suse.cz> References: <20210629191035.681913-1-krisman@collabora.com> <20210629191035.681913-7-krisman@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210629191035.681913-7-krisman@collabora.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue 29-06-21 15:10:26, Gabriel Krisman Bertazi wrote: > Similarly to fanotify_is_perm_event and friends, provide a helper > predicate to say whether a mask is of an overflow event. > > Suggested-by: Amir Goldstein > Reviewed-by: Amir Goldstein > Signed-off-by: Gabriel Krisman Bertazi > --- > fs/notify/fanotify/fanotify.h | 3 ++- > include/linux/fsnotify_backend.h | 5 +++++ > 2 files changed, 7 insertions(+), 1 deletion(-) Looks good. Feel free to add: Reviewed-by: Jan Kara Honza > > diff --git a/fs/notify/fanotify/fanotify.h b/fs/notify/fanotify/fanotify.h > index fd125a949187..2e005b3a75f2 100644 > --- a/fs/notify/fanotify/fanotify.h > +++ b/fs/notify/fanotify/fanotify.h > @@ -328,7 +328,8 @@ static inline struct path *fanotify_event_path(struct fanotify_event *event) > */ > static inline bool fanotify_is_hashed_event(u32 mask) > { > - return !fanotify_is_perm_event(mask) && !(mask & FS_Q_OVERFLOW); > + return !(fanotify_is_perm_event(mask) || > + fsnotify_is_overflow_event(mask)); > } > > static inline unsigned int fanotify_event_hash_bucket( > diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h > index c4473b467c28..f9e2c6cd0f7d 100644 > --- a/include/linux/fsnotify_backend.h > +++ b/include/linux/fsnotify_backend.h > @@ -495,6 +495,11 @@ static inline void fsnotify_queue_overflow(struct fsnotify_group *group) > fsnotify_add_event(group, group->overflow_event, NULL, NULL); > } > > +static inline bool fsnotify_is_overflow_event(u32 mask) > +{ > + return mask & FS_Q_OVERFLOW; > +} > + > static inline bool fsnotify_notify_queue_is_empty(struct fsnotify_group *group) > { > assert_spin_locked(&group->notification_lock); > -- > 2.32.0 > -- Jan Kara SUSE Labs, CR