From: Amir Goldstein <amir73il@gmail.com>
To: Michael Kerrisk <mtk.manpages@gmail.com>
Cc: Jan Kara <jack@suse.cz>,
Matthew Bobrowski <mbobrowski@mbobrowski.org>,
linux-man@vger.kernel.org
Subject: [PATCH 1/4] fanotify_mark.2: Clarification about FAN_MARK_MOUNT and FAN_REPORT_FID
Date: Mon, 20 Apr 2020 21:42:56 +0300 [thread overview]
Message-ID: <20200420184259.29406-2-amir73il@gmail.com> (raw)
In-Reply-To: <20200420184259.29406-1-amir73il@gmail.com>
It is not true that FAN_MARK_MOUNT cannot be used with a group that
was initialized with flag FAN_REPORT_FID.
The correct assertion is that events that require a group with flag
FAN_REPORT_FID cannot be requested on a mark mount.
For exaple, a FAN_OPEN event can be requested on a mark mount and
will generate an event with file handle information if the group was
initialized with flag FAN_REPORT_FID.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Matthew Bobrowski <mbobrowski@mbobrowski.org>
---
man2/fanotify_mark.2 | 41 ++++++++++++++++++++++++++++++++++++-----
1 file changed, 36 insertions(+), 5 deletions(-)
diff --git a/man2/fanotify_mark.2 b/man2/fanotify_mark.2
index 30290d519..687e20f4a 100644
--- a/man2/fanotify_mark.2
+++ b/man2/fanotify_mark.2
@@ -126,12 +126,22 @@ is not itself a mount point, the mount point containing
will be marked.
All directories, subdirectories, and the contained files of the mount point
will be monitored.
-This value cannot be used if the
+The events which require the
.I fanotify_fd
-file descriptor has been initialized with the flag
-.BR FAN_REPORT_FID
-or if any of the new directory modification events are provided as a
-.IR mask .
+file descriptor to have been intialized with the flag
+.BR FAN_REPORT_FID ,
+such as
+.BR FAN_CREATE ,
+.BR FAN_ATTRIB ,
+.BR FAN_MOVE ,
+and
+.BR FAN_DELETE_SELF ,
+cannot be provided as a
+.IR mask
+when
+.I flags
+contains
+.BR FAN_MARK_MOUNT .
Attempting to do so will result in the error
.B EINVAL
being returned.
@@ -184,34 +194,55 @@ See NOTES for additional details.
.BR FAN_ATTRIB " (since Linux 5.1)"
.\" commit 235328d1fa4251c6dcb32351219bb553a58838d2
Create an event when the metadata for a file or directory has changed.
+An fanotify file descriptor created with
+.B FAN_REPORT_FID
+is required.
.TP
.BR FAN_CREATE " (since Linux 5.1)"
.\" commit 235328d1fa4251c6dcb32351219bb553a58838d2
Create an event when a file or directory has been created in a marked
parent directory.
+An fanotify file descriptor created with
+.B FAN_REPORT_FID
+is required.
.TP
.BR FAN_DELETE " (since Linux 5.1)"
.\" commit 235328d1fa4251c6dcb32351219bb553a58838d2
Create an event when a file or directory has been deleted in a marked
parent directory.
+An fanotify file descriptor created with
+.B FAN_REPORT_FID
+is required.
.TP
.BR FAN_DELETE_SELF " (since Linux 5.1)"
.\" commit 235328d1fa4251c6dcb32351219bb553a58838d2
Create an event when a marked file or directory itself is deleted.
+An fanotify file descriptor created with
+.B FAN_REPORT_FID
+is required.
.TP
.BR FAN_MOVED_FROM " (since Linux 5.1)"
.\" commit 235328d1fa4251c6dcb32351219bb553a58838d2
Create an event when a file or directory has been moved from a marked
parent directory.
+An fanotify file descriptor created with
+.B FAN_REPORT_FID
+is required.
.TP
.BR FAN_MOVED_TO " (since Linux 5.1)"
.\" commit 235328d1fa4251c6dcb32351219bb553a58838d2
Create an event when a file or directory has been moved to a marked parent
directory.
+An fanotify file descriptor created with
+.B FAN_REPORT_FID
+is required.
.TP
.BR FAN_MOVE_SELF " (since Linux 5.1)"
.\" commit 235328d1fa4251c6dcb32351219bb553a58838d2
Create an event when a marked file or directory itself has been moved.
+An fanotify file descriptor created with
+.B FAN_REPORT_FID
+is required.
.TP
.B FAN_Q_OVERFLOW
Create an event when an overflow of the event queue occurs.
--
2.17.1
next prev parent reply other threads:[~2020-04-20 18:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-20 18:42 [PATCH 0/4] fanotify updates for v5.7 Amir Goldstein
2020-04-20 18:42 ` Amir Goldstein [this message]
2020-04-20 19:00 ` [PATCH 1/4] fanotify_mark.2: Clarification about FAN_MARK_MOUNT and FAN_REPORT_FID Michael Kerrisk (man-pages)
2020-04-20 18:42 ` [PATCH 2/4] fanotify_mark.2: Clarification about FAN_EVENT_ON_CHILD and new events Amir Goldstein
2020-04-20 19:03 ` Michael Kerrisk (man-pages)
2020-04-20 18:42 ` [PATCH 3/4] fanotify.7: Fix fanotify_fid.c example Amir Goldstein
2020-04-20 19:06 ` Michael Kerrisk (man-pages)
2020-04-20 18:42 ` [PATCH 4/4] fanotify.7, fanotify_mark.2: Document FAN_DIR_MODIFY Amir Goldstein
2020-04-20 19:25 ` Michael Kerrisk (man-pages)
2020-04-20 19:36 ` [PATCH 0/4] fanotify updates for v5.7 Michael Kerrisk (man-pages)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200420184259.29406-2-amir73il@gmail.com \
--to=amir73il@gmail.com \
--cc=jack@suse.cz \
--cc=linux-man@vger.kernel.org \
--cc=mbobrowski@mbobrowski.org \
--cc=mtk.manpages@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).