From nobody Sat Apr 05 02:40:20 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 4ZV0820fF0z5sq80 for ; Sat, 05 Apr 2025 02:40:34 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) (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 4ZV0815Dtmz49YN for ; Sat, 05 Apr 2025 02:40:33 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-5e5e0caa151so4732732a12.0 for ; Fri, 04 Apr 2025 19:40:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743820831; x=1744425631; 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=arUgvHL0EOMUXayBes8VJP6gcOptEOVE6fIkIQYU1Xg=; b=ho/7xqfiQfL/QS0NQzjY9CcL0Vxkd+HZ1FElKJonmH98tbL8uoOLPLtiWrYtXNfJDA 2Yy/JEM6ajWgeBx2BDEv5GHZGFhx38hfP3HK4JBN6XVYIDQKb+V0pBvkiJDm8SR8dGfU bRZ7JFZb9XaiSyiVlI/gELqJh+rzkei12p10546VXdhnlKGF2mUvoDHvSHHjYVsDQ2MJ oK9+1Geeu4bhHrE4t2Win4UunEr3vpbWlcRFqL9XQ2efqr1xGyAnxpNIXY+mhuU8X3GJ 0Hf8IGKY+23absu6aRhX6lcHgV9xA3qNbbCuUGOo05EO6TcrG1OsjnDCSyo/XM/CU5a5 Lung== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743820831; x=1744425631; 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=arUgvHL0EOMUXayBes8VJP6gcOptEOVE6fIkIQYU1Xg=; b=lnZ45DOy1CShw6CGyabzFXBjIxjLydKkYRtKLVVauV0uleOp98SoMuxOi0zI+6euJE 4CAQ7yx1byOAldaubs1d0JqbL8NWPceAH9GWqjtE8mrxjTrZsYyvd74rxUdzOVusS8dg ByDmxKUT3C8jrv1itOjoNUpQISb0znUnMGcy1StSSQfi+KhKCpaVmmarB2iFciLWPPWK 8dcqiunqfsgUKxU0KibZC5hY7z1a+8Piby7he+ZGOVbqXfzmXLbkE6FQCY5NB/+JtJc7 ihs3HF8s+NLsfTrWa0jSufR4ggjBIDlhq6QCGr3Jf8mHp7yLPrePVS2iqe7/yDKjef57 6ifQ== X-Gm-Message-State: AOJu0Ywuur7Ia0UMZSFxTghp5L4HaUv4SZNNajbaH+XihA4shRhM8PSz N/i0Benp6izBWWvK4I8jKBONsNJXyZOhCY29O9tLKueDr7NeqBPR+9pDV1TGEqOwfn3PLihP2xt Q7r44WpS58E+zg7P/0PhLa4Sv0g== X-Gm-Gg: ASbGncvPOBf8ez+yYkLm72iiTOd5p+TG+ALX/4MiwbhlsgMgxW3/Kq9JV0PezjtfthA UuDJkkfwyFaQQi8nUuPfUqcrjiQ4+xLbUlGFZd6I2UvTTKMN9MlnGTDyon5BMQUM0WTmHd1eQbg RdE+oqyS24UVeHufZuMYXZXmkjimZABeRDw7gL5A0FqznhG8Z0KYaCvtu8Pz67eEKTLoOA X-Google-Smtp-Source: AGHT+IG/yyvZaFUp2lKp8luvTAgH3i3ww43EdrXS3G5rRgewuQaCJHZadchF0xA/PnFrjBhLLaHjjUIv3IleOJTXHbE= X-Received: by 2002:a05:6402:350f:b0:5f0:48df:25ae with SMTP id 4fb4d7f45d1cf-5f0b5d8b510mr4187833a12.2.1743820831115; Fri, 04 Apr 2025 19:40:31 -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: Fri, 4 Apr 2025 19:40:20 -0700 X-Gm-Features: ATxdqUF381j8NmXS6JZdrqIcahQfWl3xd-V1aU9Wet2GU2ytNlsL35mqFWioo5A 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-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Queue-Id: 4ZV0815Dtmz49YN X-Spamd-Bar: ---- 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 wil= l > > > > > > > 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 su= pport > > > > > > 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 mai= n src > > > > > tree easily) > > > > > > > > Hey Rick, > > > > > > > > I applied that zfs patch, but trying pathconf(2) on a file on a ZFS > > > > 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/sha= wn > > > > 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/ho= me > > > > 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-zer= o. > > > (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 nee= d to > > > reboot (or at least remount) to get it to take effect. > > > (Maybe try setting it to "dir" and then reboot/remount. Maybe there i= s > > > 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 commit > > 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 buil= d? > > > (It needs the patched .h files in the kernel sources, not something i= n > > > /usr/include/sys > > > that has not yet been updated.) > > > All the ZFS changes are #ifdef'd, since OpenZFS requires the sources > > > build for older kernels. (Basically #ifdef'd on that VIRF_NAMEDATTR m= entioned > > > 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 "ma= ke" in > > > the module directory. > > > > > > You can try the attached trivial patch and see if it spits out "pathc= onf 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, na= med attributes) > $ mount | grep named > rpool/scratch/xattr on /scratch/xattr (zfs, local, noatime, nfsv4acls, na= med 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. Thanks for the info. For some reason, I never had to do this. I do remember fiddling around with the xattr property, setting it to sa and then to dir. Each time I rebooted the system to make the change take effect. I did notice I had to reboot to get the change in xattr setting to take eff= ect. (I wonder if the default "on" somehow doesn't take effect, but changing it to "sa" and then "dir" somehow does?) Anyhow, I'll try to incorporate the unmount/mount with the xattr option int= o the man page I need to write. Thanks for figuring this out, 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/0= 3A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc