On Thu, Jun 20, 2024 at 12:41 PM Jan Kara <jack@xxxxxxx> wrote: > > On Tue 18-06-24 16:19:37, Christian Brauner wrote: > > > AFAICT this will have a side-effect that now fsnotify_open() will be > > > generated even for O_PATH open. It is true that fsnotify_close() is getting > > > > Thanks! That change seemed sensible because a close() event is > > generated. > > > > But I don't agree that generating events for O_PATH fds doesn't make > > sense on principle. But I don't care if you drop events for O_PATH now. > > Well, I can be convinced otherwise but I was not able to find a compeling > usecase for it. fanotify(8) users primarily care about file data > modification / access events and secondarily also about directory content > changes (because they change how data can be accessed). And creation of > O_PATH fds does not seem to fall into either of these categories... Not to mention the fact that security_file_open() and therefore fsnotify_open_perm() is not called for O_PATH open. It's not that we have to keep FS_OPEN balanced with FS_OPEN_PERM, but I think it will be quite odd to get FS_OPEN without FS_OPEN_PERM. I think that open an O_PATH fd fits perfectly to the design "pre path" events [1]. I have designated FAN_PATH_ACCESS (with dir id + name info) for lookup permission. Perhaps open an O_PATH can generate the same event with additional child id or another dedicated FAN_PATH_OPEN event. Thanks, Amir. [1] https://github.com/amir73il/man-pages/commits/fan_pre_path/