From nobody Sat Apr 5 15:52:06 2025 X-Original-To: freebsd-current@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 4ZVKjb6btjz5sNgp for ; Sat, 05 Apr 2025 15:52:19 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) (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 4ZVKjb0s0Pz4Lj7 for ; Sat, 05 Apr 2025 15:52:19 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=EG0yRe86; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of rick.macklem@gmail.com designates 2a00:1450:4864:20::52e as permitted sender) smtp.mailfrom=rick.macklem@gmail.com Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-5e8be1bdb7bso4854541a12.0 for ; Sat, 05 Apr 2025 08:52:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743868337; x=1744473137; 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=3JgJYB9nhRpMS8aVJH0RcR6IJMeXEI7SDLQsZyNiqWM=; b=EG0yRe86d870sP9arNuwuHu5NwNs2uVIVN/csQWEIh7+klt9b0WuaihhdcHEuPu5Rk 5bUNxVbg8dnUmi1/hbnMe1a0bdWZJipjVwjRKXuKLLQW+rJoSN2IrM6pHaF430oNrA/G dom7M4uzM1N+WxInuvUTql0lPoByFiWtk5eqjttnRAtLjJz2lLhzkFiLdttgZoyPts8a eWrlrXsOOin3a5HgxOf2IUXzNlmZg+ooGyXXrlOPeGEZIfooQ69p0g4pThGtl7UVxuEf eVPnaEIpsOaTZfEcRmmmgCd6iguV5PaDTA/DlwhV6rFiZU1/f1Xh8Ua4IZ5AlHnyl/K9 9cSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743868337; x=1744473137; 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=3JgJYB9nhRpMS8aVJH0RcR6IJMeXEI7SDLQsZyNiqWM=; b=oGMqsHBwdomYWTG+5hq+h6fa023QpBOavN6Q1ApbH5i7MHMePfIZyrbkrI1ZEiIOSO Rc0SX55v2i48Url3gMtgbdZrYAIdETuOzBESl14JIQ68AZC8l62W+6sEU8fCM6y/0Em9 FVLRTbB2RXfac6HNSXPt/ytFHvc2GirLneSviVVI0z3/4dQm6rPDo2BdruTJFouZ1Vw7 lspVry89CIn2MvpFRBJwlCqozPDMTgLKowqujVJwmZ2lkhhav+lCodMreAl+kL+Nw1JT LHngmfykwZmQiCYuHfva40zURT6v0Xm0y6qVcOTcm/+gITbvRy/VzXF5q50/WRk8ly6E 2H2Q== X-Gm-Message-State: AOJu0YyLtj8FYLwzrNoB/vzk+FlcpxwHySsiYjECgDabcjjWH8Uey9KA xnssn/e53T9W1ljp0s7kcrR8VuHVrtuds5QMaJp+SOTW1L046OlDOBuT592la4X5GZ03DsTew80 lZ/m9BUxtvvJe83nMdk2ryA4DnA== X-Gm-Gg: ASbGncvqCy++sZaszOa4vPKRgJU/P5Y4zttJIWqkjMQnjZDBj4x/zprTecctQJTu1AO TN9C4p9kK7jFd2V8REJ4zgLVwAixikRLTWOhx3khUpdQ+P993wGemu0I0sFtI2fzC/yn59bY7wr ufBAndoCrpC8JWxHNi4A/n3Z3BSnC4+KeEHGXtj8lKr+n17X3GKjpaNtP92w== X-Google-Smtp-Source: AGHT+IEdWt9SwHyTylP12ktdOsWg/LqOslgHNps1qsGnHAAPbZewmUpz5JN41nV3VVf/J65BF+rh+YusBXYutbTLKCU= X-Received: by 2002:a05:6402:430e:b0:5ed:61c8:adcf with SMTP id 4fb4d7f45d1cf-5f0db81a6b2mr2449782a12.15.1743868337070; Sat, 05 Apr 2025 08:52:17 -0700 (PDT) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org MIME-Version: 1.0 References: <2rq3bpvhclcipvgg3mo4gml7ysuzbvt6rfnzkprceumzeaeh4b@casrpprm6mgt> In-Reply-To: From: Rick Macklem Date: Sat, 5 Apr 2025 08:52:06 -0700 X-Gm-Features: ATxdqUFeVG9_VXQ2goLSbxtZCMFePLQ_XfojJ3HuEllO5ewEpnKugnkw8Hhg990 Message-ID: Subject: Re: Heads Up: commit 2ec2ba7e232d just hit main To: Shawn Webb Cc: FreeBSD CURRENT Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-3.86 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.98)[-0.985]; NEURAL_HAM_MEDIUM(-0.87)[-0.873]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; MIME_GOOD(-0.10)[text/plain]; TO_DN_ALL(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; TAGGED_FROM(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+]; FROM_HAS_DN(0.00)[]; MISSING_XM_UA(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@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]; MLMMJ_DEST(0.00)[freebsd-current@freebsd.org]; RCVD_COUNT_ONE(0.00)[1]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::52e:from] X-Rspamd-Queue-Id: 4ZVKjb0s0Pz4Lj7 X-Spamd-Bar: --- On Sat, Apr 5, 2025 at 8:50=E2=80=AFAM Rick Macklem wrote: > > On Fri, Apr 4, 2025 at 6:27=E2=80=AFPM Shawn Webb wrote: > > > > On Sat, Apr 05, 2025 at 01:04:25AM +0000, Shawn Webb wrote: > > > On Fri, Apr 04, 2025 at 05:40:21PM -0700, Rick Macklem wrote: > > > > On Fri, Apr 4, 2025 at 10:50=E2=80=AFAM Shawn Webb wrote: > > > > > > > > > > On Thu, Apr 03, 2025 at 06:12:59PM -0700, Rick Macklem wrote: > > > > > > On Thu, Apr 3, 2025 at 4:52=E2=80=AFPM Shawn Webb wrote: > > > > > > > > > > > > > > On Wed, Apr 02, 2025 at 01:51:26PM -0700, Rick Macklem wrote: > > > > > > > > The commit 2ec2ba7e232d just hit main. I do not think it w= ill > > > > > > > > cause problems, but it is fairly large. > > > > > > > > > > > > > > > > Man page updates will be done as separate commits. > > > > > > > > > > > > > > > > Hopefully this will not cause grief, rick > > > > > > > > > > > > > > Hey Rick, > > > > > > > > > > > > > > The patch review test plan mentions a patch to ZFS itself to = support > > > > > > > named attributes. Is that patch available somewhere? > > > > > > The ZFS patch is currently in phabricator as D49654. > > > > > > Feel free to review it. > > > > > > > > > > > > It can also be found at: > > > > > > https://people.freebsd.org/~rmacklem/zfs-xattr.patch > > > > > > (this is a smaller diff which can be applied to an up-to-date m= ain src > > > > > > tree easily) > > > > > > > > > > Hey Rick, > > > > > > > > > > I applied that zfs patch, but trying pathconf(2) on a file on a Z= FS > > > > > dataset with xattr=3Don (which seems to be the default) returns 0= . Am I > > > > > doing something wrong? > > > > > > > > > > =3D=3D=3D=3D BEGIN LOG =3D=3D=3D=3D > > > > > hbsd-current-01[shawn]:/home/shawn/tmp $ ./xattrtest xattrtest > > > > > xattrtest: Named attributes not enabled: No error: 0 > > > > > hbsd-current-01[shawn]:/home/shawn/tmp (1) $ zfs list /usr/home/s= hawn > > > > > NAME USED AVAIL REFER MOUNTPOINT > > > > > rpool/usr/home 10.4G 71.4G 9.85G /usr/home > > > > > hbsd-current-01[shawn]:/home/shawn/tmp $ zfs get xattr rpool/usr/= home > > > > > NAME PROPERTY VALUE SOURCE > > > > > rpool/usr/home xattr on default > > > > > =3D=3D=3D=3D END LOG =3D=3D=3D=3D > > > > > > > > > > That xattrtest application is yours from: > > > > > https://people.freebsd.org/~rmacklem/xattrtest.c > > > > No idea. It works for me. You used up-to-date kernel sources? > > > > (Check that VIRF_NAMEDATTR is defined in sys/sys/vnode.h.) > > > > Oh, and one more thing to check. zfs_xattr_compat needs to be non-z= ero. > > > > (It's found in sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_= os.c. > > > > It's initialized to 1 and I don't see anything that sets it to 0?) > > > > > > It is indeed set to 1. > > > > > > > > > > > The only thing I can think if is, if you changed xattr to on, you n= eed to > > > > reboot (or at least remount) to get it to take effect. > > > > (Maybe try setting it to "dir" and then reboot/remount. Maybe there= is > > > > a difference between "on" and "dir"?) > > > > > > Yeah, tried rebooting and still no go. Note that xattr defaults to > > > "on" in FreeBSD by default. My src tree is synced up to FreeBSD commi= t > > > 7e70d94acd68b3ac6b45f49d4ab7a0f7867c3ea7. I brought in the ZFS patch > > > you linked to. > > > > > > > > > > > Or, did you build zfs.ko some other way than as part of a kernel bu= ild? > > > > (It needs the patched .h files in the kernel sources, not something= in > > > > /usr/include/sys > > > > that has not yet been updated.) > > > > All the ZFS changes are #ifdef'd, since OpenZFS requires the source= s > > > > build for older kernels. (Basically #ifdef'd on that VIRF_NAMEDATTR= mentioned > > > > above.) > > > > > > Perhaps I need to do a clean build. I'll try that and report back. > > > > > > > > > > > It does remind me that I need to try a build of zfs.ko by doing a "= make" in > > > > the module directory. > > > > > > > > You can try the attached trivial patch and see if it spits out "pat= hconf ret=3D1" > > > > on the console. > > > > > > I'll try that after a clean rebuild of the kernel. > > > > Clean rebuild didn't resolve it. However, I made some progress. > > > > I created a dataset specifically for this since I can't really unmount > > my /usr/home dataset, so my example down below is a bit different than > > the previous example I gave. > > > > The xattr property is set to "on" for the dataset. However, it's not > > mounted with the xattr property. In order to get it to work, I had to > > run the following commands: > > > > =3D=3D=3D=3D BEGIN LOG =3D=3D=3D=3D > > $ sudo zfs umount rpool/scratch/xattr > > $ sudo mount -t zfs -o xattr rpool/scratch/xattr /scratch/xattr > > $ zfs get xattr rpool/scratch/xattr > > NAME PROPERTY VALUE SOURCE > > rpool/scratch/xattr xattr on local > > $ mount | grep xattr > > rpool/scratch/xattr on /scratch/xattr (zfs, local, noatime, nfsv4acls, = named attributes) > > $ mount | grep named > > rpool/scratch/xattr on /scratch/xattr (zfs, local, noatime, nfsv4acls, = named attributes) > > =3D=3D=3D=3D END LOG =3D=3D=3D=3D > > > > So it looks like FreeBSD does not honor the xattr zfs property, > > otherwise you would see a whole bunch of datasets mounted with the > > "named attributes" flag in that last `mount | grep` command. > I've looked at this a little more... > There is a function xattr_changed_cb() that updates the xattr property > information. > It gets called when "zfs set xattr=3DXX " is done or when > the mount option "xattr" is set. > > The question seems to be "Why was the stuff not correctly set for your fi= le > systems, although they show xattr=3Don?" > Maybe I'll try and ask somewhere there are ZFS wizards or look in some > OpenZFS commit logs. > > Have your ZFS file systems that do not have "named attribute" set been > around for quite a while? (I'm thinking that they might have been configu= red > differently when they were created and never changed.) > > It does look like the commands (done as root) should do the same thing > as your umount/mount did. > # zfs set xattr=3Doff > # zfs set xattr=3Ddir Oh, and followed by a reboot or umount/mount without the xattr mount option= . > > I'll poke around and see if I can find out what the story is, rick > > > > > -- > > Shawn Webb > > Cofounder / Security Engineer > > HardenedBSD > > > > Signal Username: shawn_webb.74 > > Tor-ified Signal: +1 303-901-1600 / shawn_webb_opsec.50 > > https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb= /03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc