linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Jan Kara <jack@suse.cz>, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 1/9] fanotify: fix reporting event to sb/mount marks
Date: Mon, 27 Jul 2020 17:17:00 +0200	[thread overview]
Message-ID: <20200727151700.GD5284@quack2.suse.cz> (raw)
In-Reply-To: <20200722125849.17418-2-amir73il@gmail.com>

On Wed 22-07-20 15:58:41, Amir Goldstein wrote:
> When reporting event with parent/name info, we should not skip sb/mount
> marks mask if event has FAN_EVENT_ON_CHILD in the mask.
> 
> This check is a leftover from the time when the event on child was
> reported in a separate callback than the event on parent and we did
> not want to get duplicate events for sb/mount mark.
> 
> Fixes: eca4784cbb18 ("fsnotify: send event to parent and child with single callback")
> Signed-off-by: Amir Goldstein <amir73il@gmail.com>

OK, I've decided to just drop "fanotify: report both events on parent and
child with single callback" because it didn't improve anything and amend
eca4784cbb18 with this change...

								Honza

> ---
>  fs/notify/fanotify/fanotify.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c
> index a24f08a9c50f..36ea0cd6387e 100644
> --- a/fs/notify/fanotify/fanotify.c
> +++ b/fs/notify/fanotify/fanotify.c
> @@ -265,13 +265,11 @@ static u32 fanotify_group_event_mask(struct fsnotify_group *group,
>  			continue;
>  
>  		/*
> -		 * If the event is for a child and this mark doesn't care about
> -		 * events on a child, don't send it!
> -		 * The special object type "child" always cares about events on
> -		 * a child, because it refers to the child inode itself.
> +		 * If the event is for a child and this mark is on a parent not
> +		 * watching children, don't send it!
>  		 */
>  		if (event_mask & FS_EVENT_ON_CHILD &&
> -		    type != FSNOTIFY_OBJ_TYPE_CHILD &&
> +		    type == FSNOTIFY_OBJ_TYPE_INODE &&
>  		    !(mark->mask & FS_EVENT_ON_CHILD))
>  			continue;
>  
> -- 
> 2.17.1
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

  reply	other threads:[~2020-07-27 15:17 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-22 12:58 [PATCH 0/9] Fixes for fanotify name events Amir Goldstein
2020-07-22 12:58 ` [PATCH 1/9] fanotify: fix reporting event to sb/mount marks Amir Goldstein
2020-07-27 15:17   ` Jan Kara [this message]
2020-07-22 12:58 ` [PATCH 2/9] inotify: do not set FS_EVENT_ON_CHILD in non-dir mark mask Amir Goldstein
2020-07-27 15:33   ` Jan Kara
2020-07-22 12:58 ` [PATCH 3/9] audit: do not set FS_EVENT_ON_CHILD in audit marks mask Amir Goldstein
2020-07-27 15:33   ` Jan Kara
2020-07-22 12:58 ` [PATCH 4/9] fsnotify: create helper fsnotify_inode() Amir Goldstein
2020-07-27 16:26   ` Jan Kara
2020-07-22 12:58 ` [PATCH 5/9] fsnotify: simplify dir argument to handle_event() Amir Goldstein
2020-07-27 19:32   ` Jan Kara
2020-07-22 12:58 ` [PATCH 6/9] fsnotify: pass dir and inode arguments to fsnotify() Amir Goldstein
2020-07-27 21:26   ` Jan Kara
2020-07-22 12:58 ` [PATCH 7/9] fsnotify: fix merge with parent mark masks Amir Goldstein
2020-07-27 21:27   ` Jan Kara
2020-07-22 12:58 ` [PATCH 8/9] fsnotify: create method handle_inode_event() in fsnotify_operations Amir Goldstein
2020-07-27 21:27   ` Jan Kara
2020-07-22 12:58 ` [PATCH 9/9] fsnotify: pass inode to fsnotify_parent() Amir Goldstein
2020-07-27 21:29   ` Jan Kara
2020-07-27 21:57 ` [PATCH 0/9] Fixes for fanotify name events Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200727151700.GD5284@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=amir73il@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).