Re: openat(3,".",O_RDONLY|O_NAMEDATTR,00) ERR#22 'Invalid argument' in FreeBSD 15.0

From: Rick Macklem <rick.macklem_at_gmail.com>
Date: Tue, 06 Jan 2026 23:29:36 UTC
On Tue, Jan 6, 2026 at 9:44 AM Aurélien Couderc
<aurelien.couderc2002@gmail.com> wrote:
>
> openat(3,".",O_RDONLY|O_NAMEDATTR,00) returns ERR#22 'Invalid
> argument' in FreeBSD 15.0/zfs root pool.
>
> Does anyone know why?
For named attributes to work, the zfs xattr property must be set to "dir",
which is not the default. Try:
# zfs get xattr <whatever-zfs-calls the root fs?>
- If it isn't "dir", then
# zfs set xattr=dir <whatever-zfs-calls the root fs?>
(I've never set up a ZFS root fs, so I don't know what it gets called;-)

If it is set to "dir", then try some stuff with the "runat" command
to see how that behaves. (I did a trivial test of bash and it did
seem to work, but I mostly test "runat".)

rick

>
> Quick testcase:
> bash -c 'cd -@ . && ls -l'
>
> Aurélien
> --
> Aurélien Couderc <aurelien.couderc2002@gmail.com>
> Big Data/Data mining expert, chess enthusiast
>