From nobody Wed Apr 09 14:30:32 2025 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ZXljh4PMWz5rsc9 for ; Wed, 09 Apr 2025 14:30:48 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZXljf3C5zz3GsS for ; Wed, 09 Apr 2025 14:30:46 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=Sob1cSU+; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of rick.macklem@gmail.com designates 2a00:1450:4864:20::536 as permitted sender) smtp.mailfrom=rick.macklem@gmail.com Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-5e60cfef9cfso11112989a12.2 for ; Wed, 09 Apr 2025 07:30:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1744209045; x=1744813845; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=T4i/qTSjmuaenhNLrp0hPcb39xHDKS8VkG4nBAEvjyM=; b=Sob1cSU+k8u4ImRhqxCrI8dY95jb5r24VxiYGPUrfOYJtZo8UjEUNIKv6m6WoXNOwC fOtJGXOjS5W6oOML/eH5+efTbk3pJICqKrYrK/QsNYBlYOJkiJgHT8gnEzPykhgxJ69m jz8W0illubDKse9Kcyinn8dahl4h4ZbXjlHuUzjZ6IF0/rw4gWgvTFNKIdcDB8P7nS6V f7gPeSrTMzalCD1w8DeViq879SHaN3qpWRF+u1SQaiiMXSzvCIqaQi2t4oQMiiylZWKw CRWVFtkCQ085FVyB4aZooA0a6zfx1ucWonwS7Eo8YCU4JywSjHdQwY0h7ve5GWywTLFt cfOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744209045; x=1744813845; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=T4i/qTSjmuaenhNLrp0hPcb39xHDKS8VkG4nBAEvjyM=; b=dgzOxD29K36yAzDjkZ1fuEVJwaOH1xjaU5qvHoALhGr5o3wYvS5hNznTd/HcL7bYyR j/XhL3DBPmH4EqMyCuNn8qylk+8N27KtgXjU5YS2rdPZfNLAMzdbuwc7RhD2LGZ3D1rz i/2WZ1EBnYt4TfJ0FR3SC83qi+ugHgwnva4kHLiAZlnWL2C44lMUJ+0MPW8DUKzwspOb nARpcGIYVQ+Y1/NnOWCenDNRwZwQFpGv+M/v1Ju0GFicq0QKB3Nbkryf4Ypo6OjHVRPp MP5N3Uh5zjDtF7CbqnwymErQRlk6nKT9M9Ga0hHlP9GdcDl6Oos7DX0Z2V7r6Imat1yw mzpQ== X-Forwarded-Encrypted: i=1; AJvYcCWrMY8Y04SLGAPvAKiHb6gDhp4V3gXLQ7ZB5Eyokoml3TspkQ6lopMRJku/0IWe1tWNNcidDdmsvFIL9nvbuRc=@freebsd.org X-Gm-Message-State: AOJu0YzLpNpQSDpVzb5XkQNFoZ3d2o1RKhdr7VSDzZfDXVukHgXekVsd FAslX04Q1KJOLBaYL9nDPTTu/thW/w3DIMqpyhtpreEL5WYGsM7PbqGCbEl6HqpX6+KP9o6st8X +qg/4cKaiTrBaXWNUQFZTkijLAA== X-Gm-Gg: ASbGnctVirNReN5BEPkiQNQakLAcSICvbDUxSs9hyjoU/tfrTcFJAgYz/1vToViKSJN 7pSCwQK5PgvXa+a7NejdUhElAevhElG3Uo66Bvg0WULSlFG/eyQbmuULwFkFGQXoNFVyzZQN37N LbVmVtis5UP5EDlsGh/P9v/00CvFUBqP7Up5vKRHiv0b6FNsHW1LpHvg== X-Google-Smtp-Source: AGHT+IFYdCeDSbxufMAJEoC+aefBgnIb2zbmK9r/Ftoe/rozf4st1E/9EQsrJAvtw9QaG7E9loEHO+mUBUTBxPZX6IM= X-Received: by 2002:a05:6402:1e8a:b0:5f0:7290:394b with SMTP id 4fb4d7f45d1cf-5f2f77407d4mr2586869a12.27.1744209044736; Wed, 09 Apr 2025 07:30:44 -0700 (PDT) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 References: In-Reply-To: From: Rick Macklem Date: Wed, 9 Apr 2025 07:30:32 -0700 X-Gm-Features: ATxdqUEQHcuQArGEn21TfXno9UDDYRKgM5quuv6Cmy10c5wIYNCSfs-XLCAEw1A Message-ID: Subject: Re: FreeBSD NFSv4.1 nfsd, named attribute support (OPENATTR)? To: Cedric Blancher Cc: Dan Shelton , freebsd-hackers@freebsd.org, Lionel Cons Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-2.93 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.97)[-0.966]; NEURAL_HAM_MEDIUM(-0.96)[-0.963]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; MIME_GOOD(-0.10)[text/plain]; TAGGED_FROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; FREEMAIL_CC(0.00)[gmail.com,freebsd.org]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; MISSING_XM_UA(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MID_RHS_MATCH_FROMTLD(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TAGGED_RCPT(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::536:from]; RCVD_COUNT_ONE(0.00)[1]; FREEMAIL_ENVFROM(0.00)[gmail.com] X-Rspamd-Queue-Id: 4ZXljf3C5zz3GsS X-Spamd-Bar: -- On Wed, Apr 9, 2025 at 1:29=E2=80=AFAM Cedric Blancher 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 mo= st 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 unreleas= ed 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 "d= isc1" 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=3D1? 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 alr= eady in FreeBSD 2 - Because the semantics might not be exactly the same as Solaris. I am st= ill 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 wrote: > > > > On Tue, Apr 8, 2025 at 1:40=E2=80=AFPM Dan Shelton wrote: > > > > > > On Sat, 8 Mar 2025 at 16:43, Rick Macklem wr= ote: > > > > > > > > On Sun, Mar 2, 2025 at 3:48=E2=80=AFPM Rick Macklem wrote: > > > > > > > > > > On Tue, Feb 18, 2025 at 4:14=E2=80=AFPM Lionel Cons wrote: > > > > > > > > > > > > On Mon, 20 Jan 2025 at 13:15, Lionel Cons wrote: > > > > > > > > > > > > > > On Sun, 12 Jan 2025 at 16:50, Rick Macklem wrote: > > > > > > > > > > > > > > > > On Sun, Jan 12, 2025 at 2:09=E2=80=AFAM Cedric Blancher > > > > > > > > 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 ca= ll them) > > > > > > > > have been discussed multiple times. > > > > > > > > > > > > > > > > If I recall correctly, one showstopper was fixing the archi= ve tools. > > > > > > > > There was also the generic argument that Linux doesn't supp= ort them. > > > > > > > > Then there was the issue of what VFS/VOP changes were requi= red. > > > > > > > > (The FreeBSD VFS carries vnode locks across VOP calls and i= s 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 associ= ated 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) sys= call 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 ab= ove. > > > > 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=3Ddir > > 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=3Ddir" 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 > [https://plus.google.com/u/0/+CedricBlancher/] > Institute Pasteur