Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Mar 2025 06:38:22 -0600
From:      Andrew Walker <awalker@ixsystems.com>
To:        Konstantin Belousov <kib@freebsd.org>
Cc:        Rick Macklem <rick.macklem@gmail.com>, freebsd-arch@freebsd.org,  FreeBSD CURRENT <freebsd-current@freebsd.org>, Cedric Blancher <cedric.blancher@gmail.com>,  Lionel Cons <lionelcons1972@gmail.com>
Subject:   Re: RFC: Solaris style extended attributes for FreeBSD
Message-ID:  <CAB5c7xpDGV0gZhxf7GRxxgH=yAy1xks-%2Bcsw8q=BAm-eh%2BPKDQ@mail.gmail.com>
In-Reply-To: <Z81ghZUaLYyrxxhd@kib.kiev.ua>
References:  <CAM5tNy6wkfPRUpkyHB3h6=fhJHf-eFSWWNdeHV5VLA_xG7pGDA@mail.gmail.com> <Z81ghZUaLYyrxxhd@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
> Since ZFS is already wired for them, adding the basics is pretty
> straightforward. I am not suggesting that they should replace the
> current FreeBSD extended attributes

The ZFS story is more complicated. When ZFS is configured with
`xattr=sa`, xattrs are preferentially written into system attributes
(SA). This was introduced IIRC primarily for performance reasons
This allows tiny xattrs (~100 bytes) to be stored with the dnode and
up to 64 KiB of xattrs to be stored in the dnode spill block. If
additional space is needed then they are written using the older-style
file-backed approach.

What this means is that if someone is using this relatively common
configuration (the default in TrueNAS and in many Linux distros), then
the result would be that only some xattrs written via extattr would be
visible by directly opening the ZFS attr dir. It would also introduce
a mechanism whereby an xattr with the same name is written to two
different ZFS locations, which would potentially cause you to see
different xattr data depending on whether you read it from extattr or
via the attr dir. I don't know off-hand whether this could lead to
corruption / unexpected behavior in ZFS but if you haven't looked into
it yet you may want to make sure you're properly handling the case
where someone has already written SA-backed xattrs.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAB5c7xpDGV0gZhxf7GRxxgH=yAy1xks-%2Bcsw8q=BAm-eh%2BPKDQ>