Message ID | 20210521024134.1032503-4-krisman@collabora.com |
---|---|
State | Superseded |
Headers | show |
Series | File system wide monitoring | expand |
On Fri, May 21, 2021 at 5:42 AM Gabriel Krisman Bertazi <krisman@collabora.com> 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 <krisman@collabora.com> > --- > 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.
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;
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 <krisman@collabora.com> --- fs/notify/fanotify/fanotify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)