HomeFreeBSD

Add support for FreeBSD's Solaris style extended attribute interface

Description

Add support for FreeBSD's Solaris style extended attribute interface

FreeBSD commit 2ec2ba7e232d added the Solaris style syscall interface
for extended attributes. This patch wires this interface into the
FreeBSD ZFS port, since this style of extended attributes is supported
by OpenZFS internally when the "xattr" property is set to "dir".

Some specific changes:
LOOKUP_NAMED_ATTR is defined to indicate the need to set V_NAMEDATTR
for calls to zfs_zaccess().
V_NAMEDATTR indicates that the access checking does need to be done
for FreeBSD.

The access checking code for extended attributes was copy/pasted from
the Linux port into zfs_zaccess() in the FreeBSD port.

Most of the changes are in zfs_freebsd_lookup() and
zfs_freebsd_create().
The semantics of these functions should remain unchanged unless named
attributes are being manipulated.

All the code changes are enabled for __FreeBSD_version 1500040 and
newer.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Signed-off-by: Rick Macklem <rmacklem@uoguelph.ca>
Closes #17540

Details

Provenance
rmacklemAuthored on Jul 30 2025, 4:49 PM
GitHub <noreply@github.com>Committed on Jul 30 2025, 4:49 PM
Parents
rGdea0fc969ba9: ZVOL: Return early, if volmode is ZFS_VOLMODE_NONE on FreeBSD side
Branches
Unknown
Tags
Unknown