linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* FAN_REPORT_CHILD_FID
@ 2021-07-11 17:02 Amir Goldstein
  2021-07-12 11:10 ` FAN_REPORT_CHILD_FID Jan Kara
  0 siblings, 1 reply; 12+ messages in thread
From: Amir Goldstein @ 2021-07-11 17:02 UTC (permalink / raw)
  To: Jan Kara; +Cc: linux-fsdevel, Matthew Bobrowski

Jan,

I am struggling with an attempt to extend the fanotify API and
I wanted to ask your opinion before I go too far in the wrong direction.

I am working with an application that used to use inotify rename
cookies to match MOVED_FROM/MOVED_TO events.
The application was converted to use fanotify name events, but
the rename cookie functionality was missing, so I am carrying
a small patch for FAN_REPORT_COOKIE.

I do not want to propose this patch for upstream, because I do
not like this API.

What I thought was that instead of a "cookie" I would like to
use the child fid as a way to pair up move events.
This requires that the move events will never be merged and
therefore not re-ordered (as is the case with inotify move events).

My thinking was to generalize this concept and introduce
FAN_REPORT_CHILD_FID flag. With that flag, dirent events
will report additional FID records, like events on a non-dir child
(but also for dirent events on subdirs).

Either FAN_REPORT_CHILD_FID would also prevent dirent events
from being merged or we could use another flag for that purpose,
but I wasn't able to come up with an idea for a name for this flag :-/

I sketched this patch [1] to implement the flag and to document
the desired semantics. It's only build tested and I did not even
implement the merge rules listed in the commit message.

[1] https://github.com/amir73il/linux/commits/fanotify_child_fid

There are other benefits from FAN_REPORT_CHILD_FID which are
not related to matching move event pairs, such as the case described
in this discussion [2], where I believe you suggested something along
the lines of FAN_REPORT_CHILD_FID.

[2] https://lore.kernel.org/linux-fsdevel/CAOQ4uxhEsbfA5+sW4XPnUKgCkXtwoDA-BR3iRO34Nx5c4y7Nug@mail.gmail.com/

Thoughts?

Amir.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-07-28  9:52 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-11 17:02 FAN_REPORT_CHILD_FID Amir Goldstein
2021-07-12 11:10 ` FAN_REPORT_CHILD_FID Jan Kara
2021-07-12 13:00   ` FAN_REPORT_CHILD_FID Amir Goldstein
2021-07-12 16:26     ` FAN_REPORT_CHILD_FID Jan Kara
2021-07-12 18:08       ` FAN_REPORT_CHILD_FID Amir Goldstein
2021-07-14  1:16         ` FAN_REPORT_CHILD_FID Matthew Bobrowski
2021-07-14 12:09           ` FAN_REPORT_CHILD_FID Amir Goldstein
2021-07-15 23:53             ` FAN_REPORT_CHILD_FID Matthew Bobrowski
2021-07-16  9:47               ` FAN_REPORT_CHILD_FID Jan Kara
2021-07-16 11:24                 ` FAN_REPORT_CHILD_FID Amir Goldstein
2021-07-27 10:44                   ` FAN_REPORT_CHILD_FID Amir Goldstein
2021-07-28  9:51                     ` FAN_REPORT_CHILD_FID Amir Goldstein

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).