On Fri, Jun 17, 2022 at 4:53 PM Alejandro Colomar <alx.manpages@xxxxxxxxx> wrote: > > On 6/17/22 15:11, Amir Goldstein wrote: > > FAN_RENAME is a new event type that includes information about > > both old and new directory entries. > > > > It is a successor of the two separate FAN_MOVED_TO/FROM events, > > but those event types are still supported. > > > > Reviewed-by: Matthew Bobrowski <repnop@xxxxxxxxxx> > > Signed-off-by: Amir Goldstein <amir73il@xxxxxxxxx> > > Please, also check some minor comments below for this patch. > > Cheers, > > Alex > > > --- > > man2/fanotify_init.2 | 21 +++++++++++++++++---- > > man2/fanotify_mark.2 | 16 ++++++++++++++++ > > man7/fanotify.7 | 4 ++++ > > 3 files changed, 37 insertions(+), 4 deletions(-) > > > > diff --git a/man2/fanotify_init.2 b/man2/fanotify_init.2 > > index ac4d3a305..bf87f394b 100644 > > --- a/man2/fanotify_init.2 > > +++ b/man2/fanotify_init.2 > > @@ -173,6 +173,7 @@ Additionally, it may be used for applications monitoring a directory or a > > filesystem that are interested in the directory entry modification events > > .BR FAN_CREATE , > > .BR FAN_DELETE , > > +.BR FAN_RENAME , > > and > > .BR FAN_MOVE , > > See below. > > > or in events such as > > @@ -257,6 +258,15 @@ For the directory entry modification events > > and > > .BR FAN_MOVE , > > the reported name is that of the created/deleted/moved directory entry. > > +The event > > +.B FAN_RENAME > > Why does RENAME appear sometimes after and sometimes before MOVE? > > > +may contain two information records. > > +One of type > > +.B FAN_EVENT_INFO_TYPE_OLD_DFID_NAME > > +identifying the old directory entry, > > +and another of type > > +.B FAN_EVENT_INFO_TYPE_NEW_DFID_NAME > > +identifying the new directory entry. > > For other events that occur on a directory object, the reported file handle > > is that of the directory object itself and the reported name is '.'. > > For other events that occur on a non-directory object, the reported file handle > > @@ -301,14 +311,17 @@ will be returned. > > For the directory entry modification events > > .BR FAN_CREATE , > > .BR FAN_DELETE , > > +.BR FAN_RENAME , > > and > > .BR FAN_MOVE , > > See above. There are more cases below. Please check all of them, and > try to be consistent, if no other more important reason applies. > The only reason is to minimize changed lines. Consistency is more important, so I'll fix this up. Thanks, Amir.