Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp971435pxj; Fri, 21 May 2021 03:31:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVvQVbYeMtsJltWdjE6I0BWeHrGf7apGeQptABLqQuNdzAu6vcafxc5UxOeSawE6GrCjRF X-Received: by 2002:a5e:930d:: with SMTP id k13mr11312245iom.61.1621593108631; Fri, 21 May 2021 03:31:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621593108; cv=none; d=google.com; s=arc-20160816; b=b6u0zRnpkWJbuH4dCLfcdKEPNN55RWaOnM1blEtZyN7iU3bj4Sjt17pISHBp3j/tod P1DdzoE8yHWdVqvcmuKjta/jziMs1Ww1quVFSjPt71GUINoArfVJyAMSHHGmfp7VuE15 G8QzHrEOOSbFZaqA2wlgmUnUOQKA6T3weO81YoY+xtiD/khgWBIw7NfD8i1FwM5I/b9U aQw/fWVEL3iIcdS6UOECezimWsASmLFfA8N8zRslF6erd8vjI2lEOs+Jr8xx9OLincmk 7Nsf6FGQUYL/U4hymQhZwdAQmFDt6hPY862+IKBGQEjVExBJAhBHYz6IgMfnjxEFYjjD BCkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=P6pxCwi+D5s8azlsfRaUrcmqzzTrPKX02TfNNafLt3E=; b=wTQa+H4enzwjK0uKKeefpNz2cBA3qabEVjCPPwRUjvBg2h/Sw09fWUJHzDYDAZ6UQy A8tt1eOH2yq4+s9JIqkdaREckEeCAJDilWI+27trE4+SCNKJLna5VDZbGs3aiZSQqJXV OKtkIYEcLf3Ngea8oqSTdRgR5uTUeKC5Dv5mlwOUyLA07GO58AZDNFoSKs1oGT+CvCaR pox52MTjzEE97ECvb00+x3scMsUuGl8O/CwFa6U8Zxwdtw0ZydF1e1SBO+aNblnWytoB ZD48lEUexq0pfGySpO98vgiqzJr0QTU3MBBlhBZSKWQjKwKOkXJL51mcnqFn0uMHOYDr 3UJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FYVlThmP; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n20si5400143jat.115.2021.05.21.03.31.34; Fri, 21 May 2021 03:31:48 -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=@gmail.com header.s=20161025 header.b=FYVlThmP; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229581AbhEUIjG (ORCPT + 99 others); Fri, 21 May 2021 04:39:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233465AbhEUIjD (ORCPT ); Fri, 21 May 2021 04:39:03 -0400 Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB61CC061574; Fri, 21 May 2021 01:37:39 -0700 (PDT) Received: by mail-io1-xd31.google.com with SMTP id b25so1036346iot.5; Fri, 21 May 2021 01:37:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=P6pxCwi+D5s8azlsfRaUrcmqzzTrPKX02TfNNafLt3E=; b=FYVlThmP4Nd4QnbuMrE0VLO7rQ6aAGNWu6N1gFAmdIwGzybJIMpaN6jwNZ+hApv6JC +yI3NvxyfohS5HUxVLkH87SF3oFpI2SgesFXV8rjKoxHpWaPNtTwt2oyrXDlhTOibAzq wmc69nEtRQH8bg8t1foXosFc05S1OSzCLMaskThpaxVAprf+1xQzo3flefTDYekSe+p6 lOMJetGNNu6ruOqZKnelIf64xu9CMWZ+gS6Y/+QM8crvn625VR/UzHjveRzn74Ipnh5U hIcPhhWQdLH5OLxFhW5AOWM9r3rTOLE21/wPzlkfBn+eFkUxtyTBNYFHZYT2+IftieQU CUTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=P6pxCwi+D5s8azlsfRaUrcmqzzTrPKX02TfNNafLt3E=; b=UHphPic9LqCEJiLAzOSAk3RwfsbKQN8Av5M3Yst9P8QgW23JRa2hCVBBejFPIK0hMx y1NTRscRSieBq2u/64sysHpXFJEDh2Z4n4L9jS+ePvC4PCFR63w4CeTFNAWXt+OPmgye TKz/9sU77P0YKspnX0Mo0NwwbsFGQtPWHWJeV34JX9SylS9dKH9SAwK3G5CxrZ5D4+b7 EF2RSpMT9miRbbbqI9N/AM4fKim7Uu6Uwoas4BI1Qg55iCfuqHDvXN1BODeRG6Km1qPg 3TGyrVwlq6XjNxmfBopAbVqrnABSMXeAafz5TCD1kp/Uo/V2861SofuuewcuwThuL2lc z9FA== X-Gm-Message-State: AOAM5309Nhr9R3h69b4Ow3TYKphM7p925SSXWqTsVi9nw1BlTzzPbZKO o9858VikHHneYNfT5ZjSda3kzeJhU+ozjjJF3p4= X-Received: by 2002:a6b:3119:: with SMTP id j25mr9292411ioa.64.1621586259251; Fri, 21 May 2021 01:37:39 -0700 (PDT) MIME-Version: 1.0 References: <20210521024134.1032503-1-krisman@collabora.com> <20210521024134.1032503-4-krisman@collabora.com> In-Reply-To: <20210521024134.1032503-4-krisman@collabora.com> From: Amir Goldstein Date: Fri, 21 May 2021 11:37:28 +0300 Message-ID: Subject: Re: [PATCH 03/11] fanotify: Simplify directory sanity check in DFID_NAME mode To: Gabriel Krisman Bertazi Cc: kernel@collabora.com, "Darrick J . Wong" , "Theodore Ts'o" , Dave Chinner , Jan Kara , David Howells , Khazhismel Kumykov , linux-fsdevel , Ext4 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Fri, May 21, 2021 at 5:42 AM Gabriel Krisman Bertazi wrote: > > 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) { This change is wrong, because it regresses the case of fid_mode = FAN_REPORT_FID | FAN_REPORT_DFID_NAME which is a perfectly legal combination. Thanks, Amir.