On Thu, Mar 27, 2025 at 11:52 AM Lionel Cons <lionelcons1...@gmail.com> wrote:
>
> On Thu, 27 Mar 2025 at 19:31, Lionel Cons <lionelcons1...@gmail.com> wrote:
> >
> > On Tue, 25 Mar 2025 at 20:06, Lionel Cons <lionelcons1...@gmail.com> wrote:
> > >
> > > On Sat, 22 Mar 2025 at 21:34, Rick Macklem <rick.mack...@gmail.com> wrote:
> > > >
> > > > On Sun, Mar 9, 2025 at 5:38 AM Andrew Walker <awal...@ixsystems.com> 
> > > > wrote:
> > > > >
> > > > > > 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.
> > > > I am in the process of defining a new setting for the xattr property
> > > > I've called "named" which would need to be set for the Solaris style
> > > > extended attributes to work.
> > > >
> > > > I am making progress on the patch and am currently working through
> > > > permissions (or authorization if you prefer).
> > > >
> > > > Here is what OpenZFS appears to do currently.
> > > > I am wondering if these sound reasonable for these attributes?
> > > >
> > > > - When an attr directory is created for a file object, the ownership
> > > >   (uid and gid) is set to the same value as the file object.
> > > >   The mode is set to 041777 (a directory with sticky bit set and
> > > >   permissions for everyone. (It ignores the "mode" argument to
> > > >   the open.)
> > > >   --> As such, anyone who has access to the file object can access
> > > >        the extended attribute directory.
> > >
> > > Yes, that is the expected behaviour
> > >
> > > >
> > > > - When an attribute is created in the attribute directory, the uid is
> > > >    set to that of the creating process (cr_uid), the gid is set to that
> > > >    of the directory (which is also the gid of the file object).
> > > >    The mode is set to that of a regular file with low order mode bits
> > > >     as specified by the "mode" argument to the openat() that created
> > > >     it.
> > > >     The mode can be changed with fchmod(2).
> > > > --> As such, access to each attribute file is controlled by the
> > > >      attribute file's creator.
> > > >
> > > > Any comments on the above?
> > >
> > > Yes, that would be the expected behaviour.
> > >
> > > >
> > > > A couple of other questions...
> > > > - Should subdirectories of the attribute directory be supported?
> > > >   I currently do not allow this, but it appears to be supportable
> > > >    by both OpenZFS and NFSv4.
> > >
> > > No, please no subdirs for now. As far as I can see all consumes of
> > > such an API (Windows, MacOS etc) use flat layouts for the attribute
> > > and alternate data streams virtual dirs
> >
> > YFI Roland Mainz pointed out that
> > https://datatracker.ietf.org/doc/html/rfc5661#section-5.3 page 106
> > describes an attribute directory limits.
I have lived with this RFC for quite a few years. Yes, in the section he
has quoted it states that subdirectories cannot be created.

Then elsewhere (I'm not going to search for it now) it talks about
handling of subdirectories of the named attribute directory.
(I suppose "not being able to create them" is not the same as
"handling them, if they already exist".)

I have gone with "no subdirectories allowed" in the patch,
as suggested by Lionel.

> >
> > Lionel
>
> Is there a freebsd mailinglist with minimum other traffic where this
> kind of debate&planning can be done?
There is no mailing list specific to NFS for FreeBSD.
Also, "low noise" implies people that need to see the discussion do
not see it. (I don't find freebsd-current@ too noisy and freebsd-arch@
is read by few. I included it here, since it is technically the correct
place for "new feature" discussions.)

rick
>
> Lionel

Reply via email to