Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp928058pxj; Fri, 21 May 2021 02:24:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPTXWzClNkjmosZ/XdBj/iyWU/9hAkSg/D/Oiwba9vLZpsyTC20qE5r9+zhHDwE9OMzr3T X-Received: by 2002:a17:906:dfcb:: with SMTP id jt11mr9122113ejc.362.1621589046412; Fri, 21 May 2021 02:24:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621589046; cv=none; d=google.com; s=arc-20160816; b=LE62k4dnkaoGkG/xif/vYfpK6ZffJ/U6Q4efE51Et3oxwiX/Gmu3nR+uf7ia84t6Pb OJp3/1lk0BLNIEUDHcekvT8CRTOEGZSOoOWFmFmEv/C59IZzbC60AwgDaYwcOS4GkTk5 ZeKrNLN7cu5uYPiGkBmTTbk489fBhjwV55NjDkMQ/79LMDbarPu7kf5D4dXpygJpFMtd SJsjOca7O3N8JP14vOAZTCJ9JyYsc6ktC73Px6UtsgR1CLgFlKTIYmvMId1HCPAY12Zx ywgcjw6GZvSPGZDAjJ0Ku1GKuG0BVBi+64bbZJueurE0YdWKlFU9vnGnY/bo+rqof4aq GxPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=5OUYJE4oPoZRuUy0StmcoyQJAp4dJgEtIIlKi9eemt0=; b=IM3aKK7ou/a0PgXsmVfEqJdAg/rAFRItIwwFX1EOjbNRYndCUl/SoTAxT9SWkjHKVw 2+Q0VTbo/h1pgjtlFWYZBEMjn/2C6JAfpSMHrg42V5Jm5h+xxkEJo0IGHklxEyRvPEFo 0rPX/E4GuuoF+h0UupsS1Lqdg/LBq/sggo24dm6LFOErzWWrxWGbKf0lhy5nWTpplAhf cJWvp8c/+SVQWLWSto1kWYTQwUtSP4V5xMRgJlARxoD4gfKcFmKNfVbtXQ8zWgGouYbb 7HLkICU3e2iE1/bN3uYR57JLFZQyt0SsoRNTPSSYyZ7X5R3q2QrlVRumpvvMEo9Fz2Wb NmOg== 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 cc18si5536037edb.583.2021.05.21.02.23.43; Fri, 21 May 2021 02:24:06 -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 S233937AbhEUCne (ORCPT + 99 others); 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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-ext4@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; -- 2.31.0