From nobody Sat Mar 08 23:02:14 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 4Z9Jb04xCrz5q7qX; Sat, 08 Mar 2025 23:02:36 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) (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 4Z9JZz4Xsrz3ZXX; Sat, 08 Mar 2025 23:02:35 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=Nk8mZeXC; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of rick.macklem@gmail.com designates 2a00:1450:4864:20::533 as permitted sender) smtp.mailfrom=rick.macklem@gmail.com Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5e5491eb379so4997159a12.3; Sat, 08 Mar 2025 15:02:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741474953; x=1742079753; darn=freebsd.org; h=cc:to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=DfKRR7ye/lAqnf2q6XmYy32yXFUvGUfzDWYnGHhrhwo=; b=Nk8mZeXClhYEh6c/XEjXBwYJfpWxT/7m+wKTpEhE3CKnoXELSES3sxe/NzWwVlaP5v R/FI2X7X5aupkbsXOgmA5LJqS0GnDX2MeRfv7wHjUFbR2lmo237cfTE5oTixbJXiwvWX 1QAxrmAO03W5+TCOyke1I/JBLGTbcxtv8TiEHcR3h4jSrmIa3CJ9yfeckOkAzdkyX7/d xXYypwwU9jlOeBMsWotxWAy4nHWyo+FQDbI6Z4gl9xlE+bBScwDr+Yy52tSakW5zpeph C3SLulfdSAptXqI6qG5SKRbI4lUkWMdrRv1L8BiPvpKhfem7G+iR6NpHHEOhQI41o0un TqCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741474953; x=1742079753; h=cc:to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=DfKRR7ye/lAqnf2q6XmYy32yXFUvGUfzDWYnGHhrhwo=; b=hzD6udo/RnFJno7KRLLAk+HQfJMk4CimWYqLgZtyHpH3A5LxHtDdMUWYCHf5uVaXUW ITPi/H71qJLVnWvPrw7SYXMQUqo0z9eyrybe3z32h7ghv+yMwcLiWWnwPDI4WzzPazM8 v/LVyXkz30SoGBnnlhCr+abKQVR0ApRUS+1j1nAOmEpG81gKXbV+k1oFt3hujHVTMUuP R1ZormO814OiEpKasXlJsYE42YOuiuMBAGgbDTYKzN18qPbDvhUTayKu+WYLULLrJToP CHDhwGLhqyz6s69Yhs9AQDteZ7UJXbl7eUFYXAnCE5WBJBRy8YBoPFFr/SaLAbbQc1oV IB2g== X-Forwarded-Encrypted: i=1; AJvYcCXYe9Rlns9OU33isW3RRu3PJ/liXEeUkHfNKzFhZKcuTX01yxq4kA6YYGKaOKrBVB0E9A3M6VmK36glt9vQlbw=@freebsd.org X-Gm-Message-State: AOJu0Yx8iNT2quqgAbZY9wM5+eQ2n2TyzZQ8Ec1DibtO8+5028vwFRWm SyMYatF0bEj9X+7fcM8sOxp6IxOwJAAKz7r8Dy+NdowRrGiyy9yQHpjCMLhSPa5mXHXTDUVoL2w dv/+8appYlZRUgqNuD8uLsG14lXoQE9Q= X-Gm-Gg: ASbGncsgMzmwJdvA/1tqe7W8wMnUx5RcDGc5sPVIN4mgicYxL37OdfXnedk7jFzCkLx v07xKPRHE8hAVLis2jvSiJnZD1oiQc1X6v7T2ccZb2SbgNVrtMN2U9ilTs1WzYrZkPvZrx8Gubw 6XEC5yrgXpMAz+Q0yjkKe6AbSHWbEUN3zUPNx4ijVESkK41XhxV9Ix+jXLhw== X-Google-Smtp-Source: AGHT+IFjOFWGq4AITiWCzQ4eUVbxvt+Ta03udYVNeLPhUSz6pU/6hsNajzjO0NeAFc2c464YvcHtTWyzj9p8rCSjBc0= X-Received: by 2002:a05:6402:3495:b0:5e6:20de:f79b with SMTP id 4fb4d7f45d1cf-5e620df0103mr3430750a12.31.1741474952717; Sat, 08 Mar 2025 15:02:32 -0800 (PST) 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 From: Rick Macklem Date: Sat, 8 Mar 2025 15:02:14 -0800 X-Gm-Features: AQ5f1JoDHEmDsAxD6_WedRSkI6-vG_7fjsw2yAjPeHjRhI1APK01O8yrevYc7dw Message-ID: Subject: RFC: Solaris style extended attributes for FreeBSD To: freebsd-arch@freebsd.org, FreeBSD CURRENT Cc: Cedric Blancher , Lionel Cons Content-Type: text/plain; charset="UTF-8" X-Spamd-Result: default: False [1.08 / 15.00]; NEURAL_SPAM_MEDIUM(0.84)[0.843]; NEURAL_SPAM_SHORT(0.67)[0.672]; NEURAL_SPAM_LONG(0.56)[0.562]; 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]; FREEMAIL_CC(0.00)[gmail.com]; FREEMAIL_FROM(0.00)[gmail.com]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; TAGGED_FROM(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MID_RHS_MATCH_FROMTLD(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::533:from]; MLMMJ_DEST(0.00)[freebsd-arch@freebsd.org,freebsd-current@freebsd.org]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TAGGED_RCPT(0.00)[]; MISSING_XM_UA(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; FREEMAIL_ENVFROM(0.00)[gmail.com] X-Rspamd-Queue-Id: 4Z9JZz4Xsrz3ZXX X-Spamd-Bar: + 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. 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. 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.) At this point I have a couple of rough patches: https://people.freebsd.org/~rmacklem/xattr.patch - the VFS/ZFS part https://people.freebsd.org/~rmacklem/nfs-xattr.patch - the NFSv4 part I have a simple test program to test the above: https://people.freebsd.org/~rmacklem/xattrtest.c The VFS/ZFS patch defines: O_NAMEDATTR - similar to O_XATTR, but uses the NFSv4 named attribute terminology to avoid confusion with the other style of FreeBSD extended attributes. (The semantics probably are not exactly the same either. I do not have a Solaris system to test on, so I am going from the NFSv4 and Solaris doc. I have handy.) --> You can look at xattrtest.c to see how this is used. I have not done any userland patches and am not sure what might be needed? (I suspect a variant of pax/tar that knows about these is the minimum?) I defined a couple of new v_irflag bits to indicate that a vnode is a named attribute directory or a named attribute. That way, they are still of v_type VDIR or VREG and can be handled by most of the code without change. So, now for the questions... 1 - Do you think this should be put in FreeBSD? (If the consensus is no, I will try and maintain out of tree patches.) 2 - If the answer for #1 is yes, what do you think is needed beyond what I already have (which is a way to open the named attribute directory and named attributes within that directory). Thanks in advance for any comments, rick