Skip to contentSkip to conversation

man: document that XFS_IOC_FS[G|S]ETXATTR can not be used on special files

PATCH Superseded Andrey Albershteyn 2 participants 2 messages Sep 11

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 man: document that XFS_IOC_FS[G|S]ETXATTR can not be used on special files

Add a CAVEATS section with an note that these ioctls can not be used on special files and leave a reference to an alternative pathname based syscall interface.

---
 man/man2/ioctl_xfs_fsgetxattr.2 | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
man/man2/ioctl_xfs_fsgetxattr.2 +18 -1
index 25a9ba7965d1..5d223138e419 100644
@@ -238,6 +238,23 @@ Caller did not have permission to change the attributes.
 This API is implemented by the ext4, xfs, btrfs, and f2fs filesystems on the
 Linux kernel.
 Not all fields may be understood by filesystems other than xfs.
+.SH CAVEATS
+The
+.B XFS_IOC_FSGETXATTR
+and
+.B XFS_IOC_FSSETXATTR
+.BR ioctl (2)
+operations require the user to open the file, but this may not be possible or
+lead to side effects on special files such as FIFOs, sockets, block devices,
+character devices, and symlinks.
+.P
+For a pathname based interface see
+.BR file_getattr (2)
+and
+.BR file_setattr (2)
+syscalls.
 .SH SEE ALSO
 .BR ioctl (2),
-.BR ioctl_iflags (2)
+.BR ioctl_iflags (2),
+.BR file_getattr (2),
+.BR file_setattr (2)
Signature · 1 line
2.55.0
Reviewed-by on v1 1/1
#1 lore raw

Hi Andrey,

Quoted 7 lines

Date: 2026-09-11 13:47:44+0200
From: Andrey Albershteyn <[email protected]>

Add a CAVEATS section with an note that these ioctls can not be used on special files and leave a reference to an alternative pathname based syscall interface.

Please add:

Cc Alejandro Colomar <[email protected]>
Cc "Darrick J. Wong" <[email protected]>
Quoted 2 lines

---

Thanks!

Quoted 10 lines
 man/man2/ioctl_xfs_fsgetxattr.2 | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
man/man2/ioctl_xfs_fsgetxattr.2 +0 -0
index 25a9ba7965d1..5d223138e419 100644
@@ -238,6 +238,23 @@ Caller did not have permission to change the attributes.
 This API is implemented by the ext4, xfs, btrfs, and f2fs filesystems on the
 Linux kernel.

man/man2/ioctl_xfs_fsgetxattr.2 Caller did not have permission to change the attributes. · line 249

Quoted 10 lines
man/man2/ioctl_xfs_fsgetxattr.2 +9 -0
 Not all fields may be understood by filesystems other than xfs.
+.SH CAVEATS
+The
+.B XFS_IOC_FSGETXATTR
+and
+.B XFS_IOC_FSSETXATTR
+.BR ioctl (2)
+operations require the user to open the file, but this may not be possible or
+lead to side effects on special files such as FIFOs, sockets, block devices,
+character devices, and symlinks.

I'd recommend that this project should use semantic newlines. See man-pages(7):

	$ MANWIDTH=64 man man-pages | awk '/Use semantic newlines/,/^$/'
	   Use semantic newlines
	     In  the  source  of a manual page, new sentences should be
	     started on new lines, long sentences should be split  into
	     lines at clause breaks (commas, semicolons, colons, and so
	     on),  and  long  clauses  should be split at phrase bound‐
	     aries.  This convention, sometimes known as "semantic new‐
	     lines", makes it easier to  see  the  effect  of  patches,
	     which  often operate at the level of individual sentences,
	     clauses, or phrases.

However, I notice that the project isn't using them, so it's up to them whether they want it for new documentation. I'd recommend using them.

man/man2/ioctl_xfs_fsgetxattr.2 Caller did not have permission to change the attributes. · line 251

Quoted 2 lines
man/man2/ioctl_xfs_fsgetxattr.2 +2 -0
+.P
+For a pathname based interface see

s/pathname based/pathname-based/

See <https://www.grammar-monster.com/lessons/hyphens_in_compound_adjectives.htm>

Also, s/see/see the/

man/man2/ioctl_xfs_fsgetxattr.2 Caller did not have permission to change the attributes. · line 260

Quoted 10 lines
man/man2/ioctl_xfs_fsgetxattr.2 +7 -1
+.BR file_getattr (2)
+and
+.BR file_setattr (2)
+syscalls.
 .SH SEE ALSO
 .BR ioctl (2),
-.BR ioctl_iflags (2)
+.BR ioctl_iflags (2),
+.BR file_getattr (2),
+.BR file_setattr (2)

Other than those minor details:

Have a lovely day!
Alex

Signature · 1 line
<https://www.alejandro-colomar.es>