From patchwork Fri May 21 02:41:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabriel Krisman Bertazi X-Patchwork-Id: 12271709 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC6B5C433B4 for ; Fri, 21 May 2021 02:42:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C06B16108B for ; Fri, 21 May 2021 02:42:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238639AbhEUCne (ORCPT ); Thu, 20 May 2021 22:43:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232440AbhEUCnd (ORCPT ); Thu, 20 May 2021 22:43:33 -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 90FB8C061574; Thu, 20 May 2021 19:42:11 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: krisman) with ESMTPSA id 3051C1F43D4C From: Gabriel Krisman Bertazi To: amir73il@gmail.com Cc: Gabriel Krisman Bertazi , kernel@collabora.com, "Darrick J . Wong" , Theodore Ts'o , Dave Chinner , jack@suse.com, dhowells@redhat.com, khazhy@google.com, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org Subject: [PATCH 03/11] fanotify: Simplify directory sanity check in DFID_NAME mode Date: Thu, 20 May 2021 22:41:26 -0400 Message-Id: <20210521024134.1032503-4-krisman@collabora.com> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210521024134.1032503-1-krisman@collabora.com> References: <20210521024134.1032503-1-krisman@collabora.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org The only fid_mode where the directory inode is reported is FAN_REPORT_DFID_NAME. So remove the negative logic and make it more straightforward. Signed-off-by: Gabriel Krisman Bertazi --- fs/notify/fanotify/fanotify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c index 057abd2cf887..711b36a9483e 100644 --- a/fs/notify/fanotify/fanotify.c +++ b/fs/notify/fanotify/fanotify.c @@ -276,7 +276,7 @@ static u32 fanotify_group_event_mask(struct fsnotify_group *group, /* Path type events are only relevant for files and dirs */ if (!d_is_reg(path->dentry) && !d_can_lookup(path->dentry)) return 0; - } else if (!(fid_mode & FAN_REPORT_FID)) { + } else if (fid_mode & FAN_REPORT_DFID_NAME) { /* Do we have a directory inode to report? */ if (!dir && !(event_mask & FS_ISDIR)) return 0;