On Fri 19-11-21 09:17:35, Amir Goldstein wrote: > In the special case of FAN_RENAME event, we record both the old > and new parent and name. > > Signed-off-by: Amir Goldstein <amir73il@xxxxxxxxx> Just one nit below: > @@ -727,6 +751,17 @@ static struct fanotify_event *fanotify_alloc_event(struct fsnotify_group *group, > } else if ((mask & ALL_FSNOTIFY_DIRENT_EVENTS) || !ondir) { > name_event = true; > } > + > + /* > + * In the special case of FAN_RENAME event, we record both > + * old and new parent+name. > + * 'dirid' and 'file_name' are the old parent+name and > + * 'moved' has the new parent+name. > + */ > + if (mask & FAN_RENAME) { > + moved = fsnotify_data_dentry(data, data_type); > + name_event = true; Why do you set 'name_event' here? It should be true due to conditions shortly above because FAN_RENAME is in ALL_FSNOTIFY_DIRENT_EVENTS, shouldn't it? Honza -- Jan Kara <jack@xxxxxxxx> SUSE Labs, CR