* [PATCH v2 2/3] fanotify: Fixes for documentation of FAN_FS_ERROR
2025-03-31 13:39 [PATCH v2 1/3] fanotify: Document FAN_REPORT_FD_ERROR Amir Goldstein
@ 2025-03-31 13:39 ` Amir Goldstein
2025-04-02 20:54 ` Alejandro Colomar
2025-03-31 13:39 ` [PATCH v2 3/3] fanotify: Document FAN_PRE_ACCESS event Amir Goldstein
2025-04-02 20:49 ` [PATCH v2 1/3] fanotify: Document FAN_REPORT_FD_ERROR Alejandro Colomar
2 siblings, 1 reply; 7+ messages in thread
From: Amir Goldstein @ 2025-03-31 13:39 UTC (permalink / raw)
To: Alejandro Colomar; +Cc: Jan Kara, linux-man
FAN_EVENT_INFO_TYPE_ERROR was missing from the list of info types.
The order of FAN_FS_ERROR entry in the event section was rather
arbitrary inside the group of fid info events.
FAN_FS_ERROR is a special event with error info, so place its entry
after the entries for fid info events and before the entries for
permission events.
Reduce unneeded newlines in the FAN_FS_ERROR entry.
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
Alejandro,
This unrelated cleanup was plit out of the FAN_PRE_ACCESS
patch and I have also added some extra cleanup in preparation for
adding mount events.
If you were going to re-organize the section describing the different
extra event info types, maybe better doing this after merging the new
types from v6.14: FAN_EVENT_INFO_TYPE_RANGE and FAN_EVENT_INFO_TYPE_MNT.
Thanks,
Amir.
man/man2/fanotify_mark.2 | 44 +++++++++++++++++++---------------------
man/man7/fanotify.7 | 7 ++++---
2 files changed, 25 insertions(+), 26 deletions(-)
diff --git a/man/man2/fanotify_mark.2 b/man/man2/fanotify_mark.2
index 47cafb21c..1d132fa1a 100644
--- a/man/man2/fanotify_mark.2
+++ b/man/man2/fanotify_mark.2
@@ -362,29 +362,6 @@ Create an event when a marked file or directory itself is deleted.
An fanotify group that identifies filesystem objects by file handles
is required.
.TP
-.BR FAN_FS_ERROR " (since Linux 5.16, 5.15.154, and 5.10.220)"
-.\" commit 9709bd548f11a092d124698118013f66e1740f9b
-Create an event when a filesystem error
-leading to inconsistent filesystem metadata is detected.
-An additional information record of type
-.B FAN_EVENT_INFO_TYPE_ERROR
-is returned for each event in the read buffer.
-An fanotify group that identifies filesystem objects by file handles
-is required.
-.IP
-Events of such type are dependent on support
-from the underlying filesystem.
-At the time of writing,
-only the
-.B ext4
-filesystem reports
-.B FAN_FS_ERROR
-events.
-.IP
-See
-.BR fanotify (7)
-for additional details.
-.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
@@ -418,6 +395,27 @@ Create an event when a marked file or directory itself has been moved.
An fanotify group that identifies filesystem objects by file handles
is required.
.TP
+.BR FAN_FS_ERROR " (since Linux 5.16, 5.15.154, and 5.10.220)"
+.\" commit 9709bd548f11a092d124698118013f66e1740f9b
+Create an event when a filesystem error
+leading to inconsistent filesystem metadata is detected.
+An additional information record of type
+.B FAN_EVENT_INFO_TYPE_ERROR
+is returned for each event in the read buffer.
+An fanotify group that identifies filesystem objects by file handles
+is required.
+Events of such type are dependent on support
+from the underlying filesystem.
+At the time of writing,
+only the
+.B ext4
+filesystem reports
+.B FAN_FS_ERROR
+events.
+See
+.BR fanotify (7)
+for additional details.
+.TP
.B FAN_OPEN_PERM
Create an event when a permission to open a file or directory is requested.
An fanotify file descriptor created with
diff --git a/man/man7/fanotify.7 b/man/man7/fanotify.7
index fd16bf294..614410cd9 100644
--- a/man/man7/fanotify.7
+++ b/man/man7/fanotify.7
@@ -395,9 +395,6 @@ A child file or directory was deleted in a watched parent.
.B FAN_DELETE_SELF
A watched file or directory was deleted.
.TP
-.B FAN_FS_ERROR
-A filesystem error was detected.
-.TP
.B FAN_RENAME
A file or directory has been moved to or from a watched parent directory.
.TP
@@ -425,6 +422,9 @@ A file or directory that was opened read-only
.RB ( O_RDONLY )
was closed.
.TP
+.B FAN_FS_ERROR
+A filesystem error was detected.
+.TP
.B FAN_Q_OVERFLOW
The event queue exceeded the limit on number of events.
This limit can be overridden by specifying the
@@ -510,6 +510,7 @@ The value of this field can be set to one of the following:
.BR FAN_EVENT_INFO_TYPE_FID ,
.BR FAN_EVENT_INFO_TYPE_DFID ,
.BR FAN_EVENT_INFO_TYPE_DFID_NAME ,
+.BR FAN_EVENT_INFO_TYPE_ERROR ,
or
.BR FAN_EVENT_INFO_TYPE_PIDFD .
The value set for this field
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2 2/3] fanotify: Fixes for documentation of FAN_FS_ERROR
2025-03-31 13:39 ` [PATCH v2 2/3] fanotify: Fixes for documentation of FAN_FS_ERROR Amir Goldstein
@ 2025-04-02 20:54 ` Alejandro Colomar
2025-04-03 10:01 ` Amir Goldstein
0 siblings, 1 reply; 7+ messages in thread
From: Alejandro Colomar @ 2025-04-02 20:54 UTC (permalink / raw)
To: Amir Goldstein; +Cc: Jan Kara, linux-man
[-- Attachment #1: Type: text/plain, Size: 4801 bytes --]
Hi Amir,
On Mon, Mar 31, 2025 at 03:39:58PM +0200, Amir Goldstein wrote:
> FAN_EVENT_INFO_TYPE_ERROR was missing from the list of info types.
>
> The order of FAN_FS_ERROR entry in the event section was rather
> arbitrary inside the group of fid info events.
>
> FAN_FS_ERROR is a special event with error info, so place its entry
> after the entries for fid info events and before the entries for
> permission events.
>
> Reduce unneeded newlines in the FAN_FS_ERROR entry.
>
> Cc: Jan Kara <jack@suse.cz>
> Signed-off-by: Amir Goldstein <amir73il@gmail.com>
> ---
>
> Alejandro,
>
> This unrelated cleanup was plit out of the FAN_PRE_ACCESS
> patch and I have also added some extra cleanup in preparation for
> adding mount events.
>
> If you were going to re-organize the section describing the different
> extra event info types, maybe better doing this after merging the new
> types from v6.14: FAN_EVENT_INFO_TYPE_RANGE and FAN_EVENT_INFO_TYPE_MNT.
>
> Thanks,
> Amir.
>
> man/man2/fanotify_mark.2 | 44 +++++++++++++++++++---------------------
> man/man7/fanotify.7 | 7 ++++---
> 2 files changed, 25 insertions(+), 26 deletions(-)
>
> diff --git a/man/man2/fanotify_mark.2 b/man/man2/fanotify_mark.2
> index 47cafb21c..1d132fa1a 100644
> --- a/man/man2/fanotify_mark.2
> +++ b/man/man2/fanotify_mark.2
> @@ -362,29 +362,6 @@ Create an event when a marked file or directory itself is deleted.
> An fanotify group that identifies filesystem objects by file handles
> is required.
> .TP
> -.BR FAN_FS_ERROR " (since Linux 5.16, 5.15.154, and 5.10.220)"
> -.\" commit 9709bd548f11a092d124698118013f66e1740f9b
> -Create an event when a filesystem error
> -leading to inconsistent filesystem metadata is detected.
> -An additional information record of type
> -.B FAN_EVENT_INFO_TYPE_ERROR
> -is returned for each event in the read buffer.
> -An fanotify group that identifies filesystem objects by file handles
> -is required.
> -.IP
You forgot the .IP in the moved text.
Cheers,
Alex
> -Events of such type are dependent on support
> -from the underlying filesystem.
> -At the time of writing,
> -only the
> -.B ext4
> -filesystem reports
> -.B FAN_FS_ERROR
> -events.
> -.IP
> -See
> -.BR fanotify (7)
> -for additional details.
> -.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
> @@ -418,6 +395,27 @@ Create an event when a marked file or directory itself has been moved.
> An fanotify group that identifies filesystem objects by file handles
> is required.
> .TP
> +.BR FAN_FS_ERROR " (since Linux 5.16, 5.15.154, and 5.10.220)"
> +.\" commit 9709bd548f11a092d124698118013f66e1740f9b
> +Create an event when a filesystem error
> +leading to inconsistent filesystem metadata is detected.
> +An additional information record of type
> +.B FAN_EVENT_INFO_TYPE_ERROR
> +is returned for each event in the read buffer.
> +An fanotify group that identifies filesystem objects by file handles
> +is required.
> +Events of such type are dependent on support
> +from the underlying filesystem.
> +At the time of writing,
> +only the
> +.B ext4
> +filesystem reports
> +.B FAN_FS_ERROR
> +events.
> +See
> +.BR fanotify (7)
> +for additional details.
> +.TP
> .B FAN_OPEN_PERM
> Create an event when a permission to open a file or directory is requested.
> An fanotify file descriptor created with
> diff --git a/man/man7/fanotify.7 b/man/man7/fanotify.7
> index fd16bf294..614410cd9 100644
> --- a/man/man7/fanotify.7
> +++ b/man/man7/fanotify.7
> @@ -395,9 +395,6 @@ A child file or directory was deleted in a watched parent.
> .B FAN_DELETE_SELF
> A watched file or directory was deleted.
> .TP
> -.B FAN_FS_ERROR
> -A filesystem error was detected.
> -.TP
> .B FAN_RENAME
> A file or directory has been moved to or from a watched parent directory.
> .TP
> @@ -425,6 +422,9 @@ A file or directory that was opened read-only
> .RB ( O_RDONLY )
> was closed.
> .TP
> +.B FAN_FS_ERROR
> +A filesystem error was detected.
> +.TP
> .B FAN_Q_OVERFLOW
> The event queue exceeded the limit on number of events.
> This limit can be overridden by specifying the
> @@ -510,6 +510,7 @@ The value of this field can be set to one of the following:
> .BR FAN_EVENT_INFO_TYPE_FID ,
> .BR FAN_EVENT_INFO_TYPE_DFID ,
> .BR FAN_EVENT_INFO_TYPE_DFID_NAME ,
> +.BR FAN_EVENT_INFO_TYPE_ERROR ,
> or
> .BR FAN_EVENT_INFO_TYPE_PIDFD .
> The value set for this field
> --
> 2.34.1
>
--
<https://www.alejandro-colomar.es/>
<https://www.alejandro-colomar.es:8443/>
<http://www.alejandro-colomar.es:8080/>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 2/3] fanotify: Fixes for documentation of FAN_FS_ERROR
2025-04-02 20:54 ` Alejandro Colomar
@ 2025-04-03 10:01 ` Amir Goldstein
2025-04-03 10:40 ` Alejandro Colomar
0 siblings, 1 reply; 7+ messages in thread
From: Amir Goldstein @ 2025-04-03 10:01 UTC (permalink / raw)
To: Alejandro Colomar; +Cc: Jan Kara, linux-man
On Wed, Apr 2, 2025 at 10:54 PM Alejandro Colomar <alx@kernel.org> wrote:
>
> Hi Amir,
>
> On Mon, Mar 31, 2025 at 03:39:58PM +0200, Amir Goldstein wrote:
> > FAN_EVENT_INFO_TYPE_ERROR was missing from the list of info types.
> >
> > The order of FAN_FS_ERROR entry in the event section was rather
> > arbitrary inside the group of fid info events.
> >
> > FAN_FS_ERROR is a special event with error info, so place its entry
> > after the entries for fid info events and before the entries for
> > permission events.
> >
> > Reduce unneeded newlines in the FAN_FS_ERROR entry.
> >
> > Cc: Jan Kara <jack@suse.cz>
> > Signed-off-by: Amir Goldstein <amir73il@gmail.com>
> > ---
> >
> > Alejandro,
> >
> > This unrelated cleanup was plit out of the FAN_PRE_ACCESS
> > patch and I have also added some extra cleanup in preparation for
> > adding mount events.
> >
> > If you were going to re-organize the section describing the different
> > extra event info types, maybe better doing this after merging the new
> > types from v6.14: FAN_EVENT_INFO_TYPE_RANGE and FAN_EVENT_INFO_TYPE_MNT.
> >
> > Thanks,
> > Amir.
> >
> > man/man2/fanotify_mark.2 | 44 +++++++++++++++++++---------------------
> > man/man7/fanotify.7 | 7 ++++---
> > 2 files changed, 25 insertions(+), 26 deletions(-)
> >
> > diff --git a/man/man2/fanotify_mark.2 b/man/man2/fanotify_mark.2
> > index 47cafb21c..1d132fa1a 100644
> > --- a/man/man2/fanotify_mark.2
> > +++ b/man/man2/fanotify_mark.2
> > @@ -362,29 +362,6 @@ Create an event when a marked file or directory itself is deleted.
> > An fanotify group that identifies filesystem objects by file handles
> > is required.
> > .TP
> > -.BR FAN_FS_ERROR " (since Linux 5.16, 5.15.154, and 5.10.220)"
> > -.\" commit 9709bd548f11a092d124698118013f66e1740f9b
> > -Create an event when a filesystem error
> > -leading to inconsistent filesystem metadata is detected.
> > -An additional information record of type
> > -.B FAN_EVENT_INFO_TYPE_ERROR
> > -is returned for each event in the read buffer.
> > -An fanotify group that identifies filesystem objects by file handles
> > -is required.
> > -.IP
>
> You forgot the .IP in the moved text.
>
I wrote "Reduce unneeded newlines in the FAN_FS_ERROR entry."
The newlines seem unneeded IMO and inconsistent with other
entries.
But it's not a big deal.
Thanks,
Amir.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 2/3] fanotify: Fixes for documentation of FAN_FS_ERROR
2025-04-03 10:01 ` Amir Goldstein
@ 2025-04-03 10:40 ` Alejandro Colomar
0 siblings, 0 replies; 7+ messages in thread
From: Alejandro Colomar @ 2025-04-03 10:40 UTC (permalink / raw)
To: Amir Goldstein; +Cc: Jan Kara, linux-man
[-- Attachment #1: Type: text/plain, Size: 553 bytes --]
Hi Amir,
On Thu, Apr 03, 2025 at 12:01:01PM +0200, Amir Goldstein wrote:
> > You forgot the .IP in the moved text.
> >
>
> I wrote "Reduce unneeded newlines in the FAN_FS_ERROR entry."
> The newlines seem unneeded IMO and inconsistent with other
> entries.
Ah, okay, I missed that. I thought it was a mistake. :)
Then I'm fine with it, I think.
Have a lovely day!
Alex
>
> But it's not a big deal.
--
<https://www.alejandro-colomar.es/>
<https://www.alejandro-colomar.es:8443/>
<http://www.alejandro-colomar.es:8080/>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 3/3] fanotify: Document FAN_PRE_ACCESS event
2025-03-31 13:39 [PATCH v2 1/3] fanotify: Document FAN_REPORT_FD_ERROR Amir Goldstein
2025-03-31 13:39 ` [PATCH v2 2/3] fanotify: Fixes for documentation of FAN_FS_ERROR Amir Goldstein
@ 2025-03-31 13:39 ` Amir Goldstein
2025-04-02 20:49 ` [PATCH v2 1/3] fanotify: Document FAN_REPORT_FD_ERROR Alejandro Colomar
2 siblings, 0 replies; 7+ messages in thread
From: Amir Goldstein @ 2025-03-31 13:39 UTC (permalink / raw)
To: Alejandro Colomar; +Cc: Jan Kara, linux-man
The new FAN_PRE_ACCESS events are created before access to a file range,
to provides an opportunity for the event listener to modify the content
of the object before the user can accesss it.
Those events are available for group in class FAN_CLASS_PRE_CONTENT
They are reported with FAN_EVENT_INFO_TYPE_RANGE info record.
Cc: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
Changed from v1:
- Added RVB
- Added FAN_PRE_ACCESS to fanotify.7
- Split out missing FAN_EVENT_INFO_TYPE_ERROR to pre patch
- Minor format fixes
man/man2/fanotify_init.2 | 4 ++--
man/man2/fanotify_mark.2 | 14 ++++++++++++
man/man7/fanotify.7 | 49 ++++++++++++++++++++++++++++++++++++++++
3 files changed, 65 insertions(+), 2 deletions(-)
diff --git a/man/man2/fanotify_init.2 b/man/man2/fanotify_init.2
index bf573c6fa..699b6f054 100644
--- a/man/man2/fanotify_init.2
+++ b/man/man2/fanotify_init.2
@@ -57,8 +57,8 @@ Only one of the following notification classes may be specified in
.B FAN_CLASS_PRE_CONTENT
This value allows the receipt of events notifying that a file has been
accessed and events for permission decisions if a file may be accessed.
-It is intended for event listeners that need to access files before they
-contain their final data.
+It is intended for event listeners that may need to write data to files
+before their final data can be accessed.
This notification class might be used by hierarchical storage managers,
for example.
Use of this flag requires the
diff --git a/man/man2/fanotify_mark.2 b/man/man2/fanotify_mark.2
index 1d132fa1a..da569279b 100644
--- a/man/man2/fanotify_mark.2
+++ b/man/man2/fanotify_mark.2
@@ -443,6 +443,20 @@ or
.B FAN_CLASS_CONTENT
is required.
.TP
+.BR FAN_PRE_ACCESS " (since Linux 6.14)"
+.\" commit 4f8afa33817a6420398d1c177c6e220a05081f51
+Create an event before read or write access to a file range,
+that provides an opportunity for the event listener
+to modify the content of the file
+before access to the content
+in the specified range.
+An additional information record of type
+.B FAN_EVENT_INFO_TYPE_RANGE
+is returned for each event in the read buffer.
+An fanotify file descriptor created with
+.B FAN_CLASS_PRE_CONTENT
+is required.
+.TP
.B FAN_ONDIR
Create events for directories\[em]for example, when
.BR opendir (3),
diff --git a/man/man7/fanotify.7 b/man/man7/fanotify.7
index 614410cd9..77dcb8aa5 100644
--- a/man/man7/fanotify.7
+++ b/man/man7/fanotify.7
@@ -247,6 +247,26 @@ struct fanotify_event_info_error {
.EE
.in
.P
+In case of
+.B FAN_PRE_ACCESS
+events,
+an additional information record describing the access range
+is returned alongside the generic
+.I fanotify_event_metadata
+structure within the read buffer.
+This structure is defined as follows:
+.P
+.in +4n
+.EX
+struct fanotify_event_info_range {
+ struct fanotify_event_info_header hdr;
+ __u32 pad;
+ __u64 offset;
+ __u64 count;
+};
+.EE
+.in
+.P
All information records contain a nested structure of type
.IR fanotify_event_info_header .
This structure holds meta-information about the information record
@@ -441,6 +461,16 @@ The reader must write a response (as described below)
that determines whether the permission to
access the filesystem object shall be granted.
.TP
+.BR FAN_PRE_ACCESS
+An application wants to access a file range, for example using
+.BR read (2),
+.BR write (2)
+or
+.BR mmap (2).
+The reader must write a response (as described below)
+that determines whether the permission to
+access the filesystem object shall be granted.
+.TP
.B FAN_OPEN_PERM
An application wants to open a file or directory.
The reader must write a response that determines whether the permission to
@@ -511,6 +541,7 @@ The value of this field can be set to one of the following:
.BR FAN_EVENT_INFO_TYPE_DFID ,
.BR FAN_EVENT_INFO_TYPE_DFID_NAME ,
.BR FAN_EVENT_INFO_TYPE_ERROR ,
+.BR FAN_EVENT_INFO_TYPE_RANGE ,
or
.BR FAN_EVENT_INFO_TYPE_PIDFD .
The value set for this field
@@ -714,6 +745,24 @@ Identifies the type of error that occurred.
This is a counter of the number of errors suppressed
since the last error was read.
.P
+The fields of the
+.I fanotify_event_info_range
+structure are as follows:
+.TP
+.I .hdr
+This is a structure of type
+.IR fanotify_event_info_header .
+The
+.I .info_type
+field is set to
+.BR FAN_EVENT_INFO_TYPE_RANGE .
+.TP
+.I .count
+The number of bytes being read or written to the file.
+.TP
+.I .offset
+The offset from which bytes are read or written to the file.
+.P
The following macros are provided to iterate over a buffer containing
fanotify event metadata returned by a
.BR read (2)
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH v2 1/3] fanotify: Document FAN_REPORT_FD_ERROR
2025-03-31 13:39 [PATCH v2 1/3] fanotify: Document FAN_REPORT_FD_ERROR Amir Goldstein
2025-03-31 13:39 ` [PATCH v2 2/3] fanotify: Fixes for documentation of FAN_FS_ERROR Amir Goldstein
2025-03-31 13:39 ` [PATCH v2 3/3] fanotify: Document FAN_PRE_ACCESS event Amir Goldstein
@ 2025-04-02 20:49 ` Alejandro Colomar
2 siblings, 0 replies; 7+ messages in thread
From: Alejandro Colomar @ 2025-04-02 20:49 UTC (permalink / raw)
To: Amir Goldstein; +Cc: Jan Kara, linux-man
[-- Attachment #1: Type: text/plain, Size: 3436 bytes --]
Hi Amir,
On Mon, Mar 31, 2025 at 03:39:57PM +0200, Amir Goldstein wrote:
> This flag from v6.13 allows reporting detailed errors on failure to
> open a file descriptor for an event.
>
> This API was backported to LTS kernels v6.12.4 and v6.6.66.
>
> Cc: Krishna Vivek Vitta <kvitta@microsoft.com>
> Reviewed-by: Jan Kara <jack@suse.cz>
> Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Thanks! I've applied the patch.
Have a lovely night!
Alex
> ---
>
> Changes from v1:
> - Added RVB
> - typo and format fixes
>
> man/man2/fanotify_init.2 | 28 ++++++++++++++++++++++++++++
> man/man7/fanotify.7 | 14 ++++++++++++++
> 2 files changed, 42 insertions(+)
>
> diff --git a/man/man2/fanotify_init.2 b/man/man2/fanotify_init.2
> index fa4ae9125..bf573c6fa 100644
> --- a/man/man2/fanotify_init.2
> +++ b/man/man2/fanotify_init.2
> @@ -364,6 +364,34 @@ so this restriction may eventually be lifted.
> For more details on information records,
> see
> .BR fanotify (7).
> +.TP
> +.BR FAN_REPORT_FD_ERROR " (since Linux 6.13 and 6.12.4 and 6.6.66)"
> +.\" commit 522249f05c5551aec9ec0ba9b6438f1ec19c138d
> +Events for fanotify groups initialized with this flag may contain
> +an error code that explains the reason for failure to open a file descriptor.
> +The
> +.I .fd
> +member of the
> +.I fanotify_event_metadata
> +structure normally contains
> +an open file descriptor associated with the object of the event
> +or FAN_NOFD in case a file descriptor could not be opened.
> +For a group initialized with this flag, instead of FAN_NOFD,
> +the
> +.I .fd
> +member of the
> +.I fanotify_event_metadata
> +structure will contain a negative error value.
> +When the group is also initialized with flag
> +.BR FAN_REPORT_PIDFD ,
> +in case a process file descriptor could not be opened,
> +the
> +.I .pidfd
> +member of the
> +.I fanotify_event_info_pidfd
> +structure will also contain a negative error value.
> +For more details, see
> +.BR fanotify (7).
> .P
> The
> .I event_f_flags
> diff --git a/man/man7/fanotify.7 b/man/man7/fanotify.7
> index a532a963a..fd16bf294 100644
> --- a/man/man7/fanotify.7
> +++ b/man/man7/fanotify.7
> @@ -335,6 +335,13 @@ file status flag is set on the open file description.
> This flag suppresses fanotify event generation.
> Hence, when the receiver of the fanotify event accesses the notified file or
> directory using this file descriptor, no additional events will be created.
> +.IP
> +When an fanotify group is initialized using
> +.BR FAN_REPORT_FD_ERROR ,
> +this field will contain a negative error value in case a file descriptor
> +could not be opened and
> +in case of a queue overflow, the value will be
> +.BR \-EBADF .
> .TP
> .I pid
> If flag
> @@ -679,6 +686,13 @@ Once the event listener has dealt with an event
> and the pidfd is no longer required,
> the pidfd should be closed via
> .BR close (2).
> +.IP
> +When an fanotify group is initialized using
> +.BR FAN_REPORT_FD_ERROR ,
> +this field will contain a negative error value
> +in case a pidfd creation failure and
> +in case of a terminated process, the value will be
> +.BR \-ESRCH .
> .P
> The fields of the
> .I fanotify_event_info_error
> --
> 2.34.1
>
--
<https://www.alejandro-colomar.es/>
<https://www.alejandro-colomar.es:8443/>
<http://www.alejandro-colomar.es:8080/>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread