Re: FreeBSD NFSv4.1 nfsd, named attribute support (OPENATTR)?
Date: Wed, 09 Apr 2025 14:30:32 UTC
On Wed, Apr 9, 2025 at 1:29 AM Cedric Blancher <cedric.blancher@gmail.com> wrote: > > 1. Which tag in https://github.com/freebsd/freebsd-src should I check > out for building? Don't use any tag, just git clone https://github.com/freebsd/freebsd-src (I'm not a git guy, so I don't even know what tags are used for, but the most recent is dated Mar., which would be before the commit.) Alternately, if you are doing a fresh install to do testing, just wait a couple of days for a new snapshot to show up (I'm not certain that what is there now has the commit) and install src when you install off it.) On FreeBSD, snapshots install like releases, but consist of recent unreleased code. If you go onto ftp.freebsd.org as anonymous ftp, they can be found in pub/FreeBSD/snapshots/ISO-IMAGES/15.0 (and dates are in the file names and ones newer than Apr. 3 should be there around Thurs.) For x86-64, you'll want one with "amd64" in the name. I use the one with "disc1" in the name, which is a full install ISO. > 2. What is better - O_NAMEDATTR or O_NAMEDATTRS? I used O_NAMEDATTR, but if others seem to think O_NAMEDATTRS is better, it could change at this early stage. > 3. Which preprocessor symbol will enable O_NAMEDATTR? _GNU_SOURCE=1? It is under __BSD_VISIBLE, which is set by default on FreeBSD. > 4. Could you also add an alias define #define O_XATTR (O_NAMEDATTR)? I chose not to call it O_XATTR for two reasons: 1 - To try and avoid confusion with the Linux style extended attributes already in FreeBSD 2 - Because the semantics might not be exactly the same as Solaris. I am still working on getting Solaris installed for interop testing, etc. If I were to create an alias I think that would subvert #2. Anyone can easily define such a thing if they have Solaris source code and want to try testing it. (If it turns out that #define O_XATTR O_NAMEDATTR makes most/all Solaris code work, maybe it could be defined under some Solaris define in fcntl.h?) > 5. Testing bash has support for O_XATTR, that might help with testing Sorry, no idea what this means? rick > > Ced > > On Tue, 8 Apr 2025 at 23:38, Rick Macklem <rick.macklem@gmail.com> wrote: > > > > On Tue, Apr 8, 2025 at 1:40 PM Dan Shelton <dan.f.shelton@gmail.com> wrote: > > > > > > On Sat, 8 Mar 2025 at 16:43, Rick Macklem <rick.macklem@gmail.com> wrote: > > > > > > > > On Sun, Mar 2, 2025 at 3:48 PM Rick Macklem <rick.macklem@gmail.com> wrote: > > > > > > > > > > On Tue, Feb 18, 2025 at 4:14 PM Lionel Cons <lionelcons1972@gmail.com> wrote: > > > > > > > > > > > > On Mon, 20 Jan 2025 at 13:15, Lionel Cons <lionelcons1972@gmail.com> wrote: > > > > > > > > > > > > > > On Sun, 12 Jan 2025 at 16:50, Rick Macklem <rick.macklem@gmail.com> wrote: > > > > > > > > > > > > > > > > On Sun, Jan 12, 2025 at 2:09 AM Cedric Blancher > > > > > > > > <cedric.blancher@gmail.com> wrote: > > > > > > > > > > > > > > > > > > Good morning! > > > > > > > > > > > > > > > > > > Does FreeBSD NFSv4.1 nfsd support named attributes (e.g. OPENATTR), > > > > > > > > > per https://datatracker.ietf.org/doc/html/rfc5661#section-5.3 > > > > > > > > > > > > > > > > > > ZFS and Solaris UFS support named attributes (via O_XATTR), does > > > > > > > > > FreeBSD do it too? > > > > > > > > No. fork files/resource forks (or whatever you choose to call them) > > > > > > > > have been discussed multiple times. > > > > > > > > > > > > > > > > If I recall correctly, one showstopper was fixing the archive tools. > > > > > > > > There was also the generic argument that Linux doesn't support them. > > > > > > > > Then there was the issue of what VFS/VOP changes were required. > > > > > > > > (The FreeBSD VFS carries vnode locks across VOP calls and is at > > > > > > > > what I would call a lower level than Solaris.) > > > > > > > > --> Which all comes down to who will do the work? > > > > > > > > > > > > > > > > If I recall correctly, there was a time when a group associated with > > > > > > > > CERN needed them to transition away from Solaris. > > > > > > > > > > > > > > That was my team, and there is still the need to do it. What keeps us > > > > > > > FRUSTRATED is the lack of progress. Well, and "no", we cannot do it > > > > > > > ourselves, this is well beyond the expertise my team has. > > > > > > > > > > > > Does anyone have any suggestions on how to proceed? > > > > > The patch found here does the very basics for ZFS (no NFSv4 code yet). > > > > > https://people.freebsd.org/~rmacklem/xattr.patch > > > > I am updating this patch regularly. What is missing are mostly the > > > > "don't do this to named attributes" checks for other syscalls. I'll be > > > > adding those soon. I have done nothing for userland. I am hoping > > > > others might step in to help with that. > > > > --> I do need opinions w.r.t. what else is needed (if anything) syscall wise. > > > > If you want to see this proceed, please test/look at the patches. > > > > > > > > There is now also a patch for the NFSv4 client/server to use the above. > > > > https://people.freebsd.org/~rmacklem/nfs-xattr.patch. > > > > > > Where does the patch define O_NAMEDATTR or O_XATTR? > > The most recent patch assumes that you have up-to-date FreeBSD > > main sources, since O_NAMEDATTR is now committed to main. > > > > Since the ZFS and NFS patches are not yet in main (ZFS takes a > > while because it must first find its way into OpenZFS), you still > > need to apply these two patches: > > https://people.freebsd.org/~rmacklem/zfs-xattr.patch > > https://people.freebsd.org/~rmacklem/nfs-xattr.patch > > > > Only ZFS supports O_NAMEDATTR and only when... > > # zfs set xattr=dir <file-system> > > is set, followed by a reboot (or maybe a remount). > > There is also an unresolved issue with older zpools, > > where the only way to get it to work is doing a mount > > with "-o xattr". (Look for a posting by Shawn Webb on > > freebsd-current@ under the Subject: Heads up... > > If you have an older zpool or the "zfs set xattr=dir" does > > not seem to have worked. > > Initial testing can be done with... > > https://www.people.freebsd/~rmacklem/xattrtest.c > > > > rick > > > > > > Dan > > > -- > > > Dan Shelton - Cluster Specialist Win/Lin/Bsd > > > > > > > > -- > Cedric Blancher <cedric.blancher@gmail.com> > [https://plus.google.com/u/0/+CedricBlancher/] > Institute Pasteur