From nobody Sat Mar 29 14:35:03 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 4ZQ0Kx2zj3z5rXHb for ; Sat, 29 Mar 2025 14:35:17 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) (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 4ZQ0Kw4fNjz3pDf for ; Sat, 29 Mar 2025 14:35:16 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-5ed1ac116e3so5253855a12.3 for ; Sat, 29 Mar 2025 07:35:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743258915; x=1743863715; 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=ltnY8r04hlOkRFNECRReX3MsBx5nMMbB0bS1bVZNHcw=; b=G3SnXzP6LedSwgrUYcoGNdQH9/8eZfEwzx2OlDW7obWcyKo1jEBvwlkS4/Dr14EAri RjoE7j2fFMQuxOYar47IhnaUvuHeFDzGk8J/eNmUcihUzJvvqvij97PZ7heEyU7g+53n Md3AISxSBj8SRhu+MLu3A27+moqu0m0YcXegzsDpXqwj9yazygTHEhzcwmlpSW3QjNxW qQcda5VEABIE7N4bSn5KqWvCY4IPhCXwrtdxfwlZYRmM2gtRwLSkcztPeQJygGMXAcdg pC3J5sP7Tm/UnhOGxjKQV+Y4djAsca47tpIeo5y/h7hf6DJ72ZpyZ4PtWgkykNXYZx4c ENeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743258915; x=1743863715; 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=ltnY8r04hlOkRFNECRReX3MsBx5nMMbB0bS1bVZNHcw=; b=LE/FXFJjf3S24kq+VWMNk0XLq94EZFPte7FwW4nbN7jhec1zrLhzGfs11pKiqBZNLu L+ncRGzoaWh6Lt2ix/IUaIGFZrinVZ7/FeKnC8+e2FgWMRlT9MCSZnIa97wQ1C6hiMJF 5owABdf8T67W1xJV5w/dp0jiiJuZRBjK0S8FutE7kOZQmw6Tf5wRPJmKkrMhhq6GGOpM C2vydeuS5ZosFmssX96qILkfwQkMhTm3HBWawNs/DU/2VQsNJJPiMkNQnKqRYMwId6Fm HhfH242knHMqjQxtoAMHuksdJRXoMb8H4lURlCZz05m3UoTaOhpvGWuYzKGHpXlD13Zh c3Sw== X-Gm-Message-State: AOJu0YzEefHIpHEXDlISBIndVQOR1kxh/wgij+6tc01k0anr0Y5Q9dnJ Tqx2tVKPkiwrr6K0rwdTUVMe2pGpQvSehTbii4PgAQlYcsE+tgE+XMc8g1kc1i2QllAEB9ehgpd bZa1xlRtEHDuR9bR4kgIAHAkYOg47 X-Gm-Gg: ASbGncsESWDyRR6xknUUKwWg0YYeTnw+lRTE0TcLyk8kuOLQj95qMFMpIeqYLhH+YjS +BZ576lO80TwuPU9de/jYvlZtcZi9a30Wcc0v1UcVDqydYuL5xwngX40M+RB3D3FFtD5/kIx4h/ 2TphGtciiAQHKxsidDC8z14nsrqchlSzFiy5OMFzikQfvWL9ks6BvdzN742A== X-Google-Smtp-Source: AGHT+IHTaubO1qxjw7QUS11ypSm8AEFkol7fJ/r3n4xEiP9iB6oSyrJc8NUhkHzQHkQfdZ064uX7+5fMvHRY1s1RzBI= X-Received: by 2002:a05:6402:1e8e:b0:5e5:c5f5:f78 with SMTP id 4fb4d7f45d1cf-5edfda04becmr2772655a12.26.1743258914347; Sat, 29 Mar 2025 07:35:14 -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: <410014e4-75a6-4923-8f84-3935cab41c31@blastwave.org> In-Reply-To: <410014e4-75a6-4923-8f84-3935cab41c31@blastwave.org> From: Rick Macklem Date: Sat, 29 Mar 2025 07:35:03 -0700 X-Gm-Features: AQ5f1JoZg-5O81lw249PuTsyJMCH7iP1SS8yr8GOt0xU4c0yato-RQtDQkmD-I4 Message-ID: Subject: Re: RFC: Solaris style extended attributes for FreeBSD To: Dennis Clarke Cc: freebsd-current@freebsd.org 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: 4ZQ0Kw4fNjz3pDf X-Spamd-Bar: ---- On Fri, Mar 28, 2025 at 1:31=E2=80=AFPM Dennis Clarke wrote: > > On 3/8/25 18:02, Rick Macklem wrote: > > First off, I cross posted because I don't think many read freebsd-arch@= . > > There seems to be a nice market for Solaris style extended attributes. > > Hold on a moment. > > I have been following this discussion now for a while and I am trying to > figure who wants this? Why? Is this a "make work" project wherein a pile > of code and testing will needed? Where the word "pile" may mean years. > > > 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. > > > > Well if you decide to go into NFS with xattr then you may as well dig > into UFS with xattr also. Perhaps that would be insane however once you > deal with ACL handling in tools like tar and ls then you will need to > ponder UFS also. That means output similar to Solaris /usr/xpg4/bin/ls > like so : > > The following example shows how to display compact ACL > information on a ZFS directory. > > % ls -dV test.dir > drwxr-xr-x 2 marks staff 2 Mar 14 10:17 test.dir > owner@:--------------:------:deny > owner@:rwxp---A-W-Co-:------:allow > group@:-w-p----------:------:deny > group@:r-x-----------:------:allow > everyone@:-w-p---A-W-Co-:------:deny > everyone@:r-x---a-R-c--s:------:allow > > The following example illustrates the ls -v behavior when > listing ACL information on a UFS file. > > $ ls -v file.3 > -rw-r--r-- 1 root root 2703 Mar 14 10:59 file.3 > 0:user::rw- > 1:group::r-- #effective:r-- > 2:mask:r-- > 3:other:r-- > > I see considerable differences between the FreeBSD base ls and Solaris > ls which does handle ACL data in both UFS and ZFS. Does this need to > be dragged onto the table along with every other file handling tool > and system call? I see a tarpit ( no pun intended ) this opens up. Well, the NFSv4 ACLs exist now in FreeBSD for ZFS and no one has been pushi= ng for "ls" to know how to display them. (See getfacl(1)) ZFS also already supports extended attributes and, as above, "ls" does not know how to display them. (See lsextattr(1), getextattr(1)...) I do not see why commands like "ls" need to know about these things. tar/pax is a different story, since archival of them seems necessary. All the patches I have created does is add a different, Solaris like syscall/KABI for manipulating extended attributes. The patches just use code that is already in ZFS to handle the extended attributes as files in a directory. ZFS currently appears to store extended attributes two ways: "zfs set xattr=3Dsa " - For this one, small extended attributes are stored in some sort of storage block. If the extended attribute is too large for the storage block, it spills over into a file in a directory. --> The alternate syscall/KAPI does not work and is disabled for this property setting. "zfs set xattr=3Don " - Also called "dir", all extended attributes are stored as regular files, with a directory holding their names. --> The alternate syscall/KAPI the patches adds provides a more direct way to access this directory and the files that store the extended attributes. The main advantage of this syscall/KAPI is that large extended attributes are supported. Since this is already how ZFS stores extended attributes, I assume send/recv knows how to deal with them. tar/pax will need to know the alternate syscall/KAPI to handle large extended attributes if this syscall/KABI is used. (The thread I mentioned over on freebsd-hackers@ mentions a patched version of pax/tar, but I have not looked at it.) Do many people need/want to handle large extended attributes? I'd guess not, but I really have no idea what FreeBSD users use? (I only hear about problems w.r.t. NFS, so I have no idea how many use it without problems.) For NFSv4, this alternate model is supported as "named attributes". There i= s as extension to NFSv4.2 for the Linux/FreeBSD model for small extended attribu= tes, but this extension doesn't work for clients on Windows, Mac OSX or Solaris. As such, there is another niche market for some NFSv4 clients. The patches are rough, but basically done. I am now in testing mode. It was= not exactly a "make work" project. More a "I was curious to see how easily the Solaris style syscall/kapi could be implemented" project. I do not see any reason why UFS would need/want this alternate syscall/kapi= , since anyone wanting/needing large extended attributes could use ZFS, which is what most managed storage will use anyhow. In summary, other than the patches I've already done, a patched version of tar/pax is about all I think is needed. rick > > > > For those not familiar with them (I am not very familiar myself;-), > > a Solaris style extended attribute is in a directory that hangs off > > the file object and the entries in the directory (the attributes) can > > be manipulated with open/read/write/lseek just like a regular file. > > (They can be as large as a regular file, but there is no atomicity > > guarantees.) > > I just, today, shutdown my last Solaris server which was a Fujitsu > SPARC64 machine and it was draining power and making heat for a number > of years in my life. Certainly it was using ZFS but not the ZFS that we > can use or "zfs send" anywhere. The botched up stuff that is totally not > compatible with OpenZFS of any flavour. This means that I had to do a > blunt force medieval tarball backup. Nothing else would ever be usable > for recovery. > > Never in the many many years of using Solaris with ZFS have I felt the > need to drag in xattr's on people. Not once in two decades. Pretty sure > I did some very early testing within the OpenSolaris project and can not > recall the desperate need thereafter. > > So who wants this? Why? Is there some atom-splitting world changing > reason that the extended attributes are needed in FreeBSD? > > > -- > -- > Dennis Clarke > RISC-V/SPARC/PPC/ARM/CISC > UNIX and Linux spoken > > ps: J=C3=B6rg Schilling wrote a very xattr aware TAR in his schilytools > > https://github.com/clausecker/schilytools > > It is cross platform aware and already in ports as "star". > > https://cgit.freebsd.org/ports/tree/archivers/star/pkg-descr > > Being fast is a matter of opinion but I used it to backup my > Fujitsu SPARC64 server today and the stats over 1Gbit NFSv3 are : > > pluto# tail -16 hubble_sparc64.star.log > a 1564 -rw-r--r-- 1 root/root May 2 04:08 2024 var/dt/Xerrors > a 5 -rw-r--r-- 1 root/root May 2 04:08 2024 var/dt/Xpid > a 0 drwxr-xr-x 2 root/root May 2 04:08 2024 vol/ > a 0 drwxr-xr-x 2 root/root May 5 22:31 2024 z/ > star: Missing links to 'proc/183/fd/3'. > star: Missing links to 'proc/108/object/a.out'. > star: fifo had 20090580 puts 45730806 gets. > star: fifo was 1092 times empty and 1548 times full. > star: fifo held 268441600 bytes max, size was 268441600 bytes > star: 45730806 blocks + 0 bytes (total of 468283453440 bytes =3D > 457308060.00k). > star: Total time 8539.200sec (53553 kBytes/sec) > star: The following problems occurred during archive processing: > star: Cannot: stat 2, open 0, read/write 42, chdir 0, iconv 349. > star: Size changed 34. > star: Missing links 2, Name too long 0, File too big 0, Not dumped 1. > star: Processed all possible files, despite earlier errors. > > So yeah, it works and you can trust it. > > > > > >