* [PATCH] fanotify.7: Fix field name in struct fanotify_event_info_fid
@ 2023-10-15 0:50 Matthew House
2023-10-15 10:43 ` Alejandro Colomar
0 siblings, 1 reply; 2+ messages in thread
From: Matthew House @ 2023-10-15 0:50 UTC (permalink / raw)
To: Alejandro Colomar; +Cc: linux-man
The final field of this struct as defined in include/uapi/linux/fanotify.h
(and as used in the example program) is called handle, not file_handle.
Fix this, and also replace the zero-length array with a flexible array
member to match the definition in the header.
Fixes: 0a4db6dc742d ("fanotify.7, fanotify_init.2, fanotify_mark.2: Document FAN_REPORT_FID and directory modification events")
Signed-off-by: Matthew House <mattlloydhouse@gmail.com>
---
man7/fanotify.7 | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/man7/fanotify.7 b/man7/fanotify.7
index 7c72a2996..1dea4c13c 100644
--- a/man7/fanotify.7
+++ b/man7/fanotify.7
@@ -207,7 +207,7 @@ structure within the read buffer:
struct fanotify_event_info_fid {
struct fanotify_event_info_header hdr;
__kernel_fsid_t fsid;
- unsigned char file_handle[0];
+ unsigned char handle[];
};
.EE
.in
@@ -576,8 +576,9 @@ and contains the same value as
when calling
.BR statfs (2).
.TP
-.I file_handle
-This is a variable length structure of type struct file_handle.
+.I handle
+This field contains a variable-length structure of type
+.IR "struct file_handle" .
It is an opaque handle that corresponds to a specified object on a
filesystem as returned by
.BR name_to_handle_at (2).
@@ -601,14 +602,14 @@ if the value of
field is
.BR FAN_EVENT_INFO_TYPE_FID ,
the
-.I file_handle
+.I handle
identifies the object correlated to the event.
If the value of
.I info_type
field is
.BR FAN_EVENT_INFO_TYPE_DFID ,
the
-.I file_handle
+.I handle
identifies the directory object correlated to the event or the parent directory
of a non-directory object correlated to the event.
If the value of
@@ -616,7 +617,7 @@ If the value of
field is
.BR FAN_EVENT_INFO_TYPE_DFID_NAME ,
the
-.I file_handle
+.I handle
identifies the same directory object that would be reported with
.B FAN_EVENT_INFO_TYPE_DFID
and the file handle is followed by a null terminated string that identifies the
@@ -796,9 +797,9 @@ but not all kinds of error types are reported by all filesystems.
.PP
Errors not directly related to a file (i.e. super block corruption)
are reported with an invalid
-.IR file_handle .
+.IR handle .
For these errors, the
-.I file_handle
+.I handle
will have the field
.I handle_type
set to
--
2.42.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] fanotify.7: Fix field name in struct fanotify_event_info_fid
2023-10-15 0:50 [PATCH] fanotify.7: Fix field name in struct fanotify_event_info_fid Matthew House
@ 2023-10-15 10:43 ` Alejandro Colomar
0 siblings, 0 replies; 2+ messages in thread
From: Alejandro Colomar @ 2023-10-15 10:43 UTC (permalink / raw)
To: Matthew House; +Cc: linux-man
[-- Attachment #1: Type: text/plain, Size: 2856 bytes --]
Hi Matthew,
On Sat, Oct 14, 2023 at 08:50:27PM -0400, Matthew House wrote:
> The final field of this struct as defined in include/uapi/linux/fanotify.h
> (and as used in the example program) is called handle, not file_handle.
> Fix this, and also replace the zero-length array with a flexible array
> member to match the definition in the header.
>
> Fixes: 0a4db6dc742d ("fanotify.7, fanotify_init.2, fanotify_mark.2: Document FAN_REPORT_FID and directory modification events")
> Signed-off-by: Matthew House <mattlloydhouse@gmail.com>
Patch applied.
<https://www.alejandro-colomar.es/src/alx/linux/man-pages/man-pages.git/commit/?h=contrib&id=daf430dfd10eb12651a112f124b438f9c8fe4ffb>
Thanks,
Alex
> ---
> man7/fanotify.7 | 17 +++++++++--------
> 1 file changed, 9 insertions(+), 8 deletions(-)
>
> diff --git a/man7/fanotify.7 b/man7/fanotify.7
> index 7c72a2996..1dea4c13c 100644
> --- a/man7/fanotify.7
> +++ b/man7/fanotify.7
> @@ -207,7 +207,7 @@ structure within the read buffer:
> struct fanotify_event_info_fid {
> struct fanotify_event_info_header hdr;
> __kernel_fsid_t fsid;
> - unsigned char file_handle[0];
> + unsigned char handle[];
> };
> .EE
> .in
> @@ -576,8 +576,9 @@ and contains the same value as
> when calling
> .BR statfs (2).
> .TP
> -.I file_handle
> -This is a variable length structure of type struct file_handle.
> +.I handle
> +This field contains a variable-length structure of type
> +.IR "struct file_handle" .
> It is an opaque handle that corresponds to a specified object on a
> filesystem as returned by
> .BR name_to_handle_at (2).
> @@ -601,14 +602,14 @@ if the value of
> field is
> .BR FAN_EVENT_INFO_TYPE_FID ,
> the
> -.I file_handle
> +.I handle
> identifies the object correlated to the event.
> If the value of
> .I info_type
> field is
> .BR FAN_EVENT_INFO_TYPE_DFID ,
> the
> -.I file_handle
> +.I handle
> identifies the directory object correlated to the event or the parent directory
> of a non-directory object correlated to the event.
> If the value of
> @@ -616,7 +617,7 @@ If the value of
> field is
> .BR FAN_EVENT_INFO_TYPE_DFID_NAME ,
> the
> -.I file_handle
> +.I handle
> identifies the same directory object that would be reported with
> .B FAN_EVENT_INFO_TYPE_DFID
> and the file handle is followed by a null terminated string that identifies the
> @@ -796,9 +797,9 @@ but not all kinds of error types are reported by all filesystems.
> .PP
> Errors not directly related to a file (i.e. super block corruption)
> are reported with an invalid
> -.IR file_handle .
> +.IR handle .
> For these errors, the
> -.I file_handle
> +.I handle
> will have the field
> .I handle_type
> set to
> --
> 2.42.0
>
--
<https://www.alejandro-colomar.es/>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-10-15 10:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-15 0:50 [PATCH] fanotify.7: Fix field name in struct fanotify_event_info_fid Matthew House
2023-10-15 10:43 ` Alejandro Colomar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox