Re: [PATCH 1/2] fanotify: prepare for setting event flags in ignore mask

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon 20-06-22 16:45:50, Amir Goldstein wrote:
> Setting flags FAN_ONDIR FAN_EVENT_ON_CHILD in ignore mask has no effect.
> The FAN_EVENT_ON_CHILD flag in mask implicitly applies to ignore mask and
> ignore mask is always implicitly applied to events on directories.
> 
> Define a mark flag that replaces this legacy behavior with logic of
> applying the ignore mask according to event flags in ignore mask.
> 
> Implement the new logic to prepare for supporting an ignore mask that
> ignores events on children and ignore mask that does not ignore events
> on directories.
> 
> To emphasize the change in terminology, also rename ignored_mask mark
> member to ignore_mask and use accessor to get only ignored events or
> events and flags.
> 
> This change in terminology finally aligns with the "ignore mask"
> language in man pages and in most of the comments.
> 
> Signed-off-by: Amir Goldstein <amir73il@xxxxxxxxx>

..

> @@ -423,7 +425,8 @@ static bool fsnotify_iter_select_report_types(
>  			 * But is *this mark* watching children?
>  			 */
>  			if (type == FSNOTIFY_ITER_TYPE_PARENT &&
> -			    !(mark->mask & FS_EVENT_ON_CHILD))
> +			    !(mark->mask & FS_EVENT_ON_CHILD) &&
> +			    !(fsnotify_ignore_mask(mark) & FS_EVENT_ON_CHILD))
>  				continue;

So now we have in ->report_mask the FSNOTIFY_ITER_TYPE_PARENT if either
->mask or ->ignore_mask have FS_EVENT_ON_CHILD set. But I see nothing that
would stop us from applying say ->mask to the set of events we are
interested in if FS_EVENT_ON_CHILD is set only in ->ignore_mask? And
there's the same problem in the other direction as well. Am I missing
something?

								Honza
-- 
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux