From nobody Fri Jun 12 07:24:34 2026 X-Original-To: bugs@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 4gc9xt1hl8z6hD14 for ; Fri, 12 Jun 2026 07:24:34 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gc9xt14wbz3fDd for ; Fri, 12 Jun 2026 07:24:34 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781249074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HUFcf9C032asOlbP2dWB8O0DAovsKiy2iwavjhsqtlo=; b=yayxplQcG8FcMwv2GpH7SOTOBD88mmUov2riM1mJvFFHKUslbMVfIeO0cKO4sshUFZNGo5 o1jjhIjo/r5Z0d6zCAoav2TNvwtMgSBj+Z7ekrsZ+HanOtGnmwPlBW0QucaYFmIuRoM7UX YFnLdeQ2u689DUXh9QhQdB6lhkttT8aLCnLoNjfBWS2kjFRBx00vXdXIAlJdrI4MTU9I4J YdL5ImiiaO38h2RtYEoIc7X5zlGRgyz2J2kkspe/w71cXclazXbQgGbaDuKf+5dEvj6KfM TQxVzHp7J+qYONm1/O0ktjOeZA7rh+ljNXsy1p1vk33vnUi9J1kIAwHiDkywtw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781249074; a=rsa-sha256; cv=none; b=J0hz7zS8JgZVvwSf/xOux3x3qQhSxdOZ8/y7gko1B1Ul3C2tRkJEG8CclafYkKKuyM6gdh 3vuibdYTbko95vC92o6SHlxr4fiq/9jkgTynsOEKVsIrPZ91auta4LDnRhWHf6AMmlMVbu 545GSHPys8YVPYmvYnVV8S8WuF8WIzqh93h9BmPE9cht0ZEcjskh+VwwjH+lcvYI51mBXj vnU+IHrwfKsu00UmVvaJ05dVBjzgrWLnPcntEYblivkSsE3EEoV1/oMm1vBJl5y/bPkT87 WZCp6oLYnQsSA+uRb84nR7CYue7MadHze0boerJXK1IHaHrCovXMCUA60ygbCw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781249074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HUFcf9C032asOlbP2dWB8O0DAovsKiy2iwavjhsqtlo=; b=VZiiel5bejALI0S8QDk/lnV1HSR3lsZqaqgxLGaYz1Q+R1QJYGFCXFaBK1VLnpWcRe7BCe wNozUjX066TS3X1vavh0WoDoFIhE/Ktviqiv1L0y5INXrPN6OujnKoCTvn12e/Vyqx9XD5 1VLVZq+ZfXjVRu8K2l1p7sbF0MSb3UkXJC2CWV3177VnBXtcdZWpPKczxExjazzWoZ7FMV xZruIZRX2omvOxA2hnj2v+yElHLVCoBVSiVir9bCOM1nhs++6TNJ5uGIHjaOg209nuxErh 7175DaYRM8YNaUHjguwZ1KpWJyf0nzKxwwXxXmGTuVQE6rX4EQ/UATFeh3JDDw== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4gc9xt0hsxzC4s for ; Fri, 12 Jun 2026 07:24:34 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 65C7OXCo009586 for ; Fri, 12 Jun 2026 07:24:33 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 65C7OX2t009585 for bugs@FreeBSD.org; Fri, 12 Jun 2026 07:24:33 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 296019] NFS4ERR_INVAL when Mac client creates file on ZFS share Date: Fri, 12 Jun 2026 07:24:34 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 15.0-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: freebsd.geography231@slmails.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D296019 Bug ID: 296019 Summary: NFS4ERR_INVAL when Mac client creates file on ZFS share Product: Base System Version: 15.0-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: freebsd.geography231@slmails.com Created attachment 271722 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D271722&action= =3Dedit tshark capture of error occurring I've got a FreeBSD server running 15.0-RELEASE-p10, exporting a ZFS shares = via NFSv4 to a Linux client, no issues. I recently tried to connect a macOS 26.5 "Tahoe" client to it via NFSv4, and after figuring out the right configurat= ion I needed to put into the Mac's /etc/nfs.conf, I was able to get it mounted. Reading and writing existing files from the Mac works as expected, but I ca= nnot create new files. From the Mac's terminal: $ touch /Volumes/storage/test touch: /Volumes/storage/test: Invalid argument $ Doesn't matter how I try to do it, or with what app: if something tries to write to a new file on the NFS mount, it fails. Editing existing files works fine, though! I did a bunch of troubleshooting and eventually started tryin= g to inspect the NFS conversation with a packet capture. I don't have the necess= ary understanding of the NFS protocol itself, so I enlisted an AI model to help= me make understand it. After several rounds of investigation, and switching fr= om tcpdump to tshark at the AI's request for its supposedly-greater NFS-decodi= ng abilities, the AI arrived at the following conclusion: "Packet captures reveal that the client is sending time_create (birthtime) = and explicitly setting flags to 0 in the createattrs. The FreeBSD NFS server translates these into a struct vattr and passes them to VOP_CREATE(). Howev= er, ZFS's implementation of VOP_CREATE returns EINVAL if va_flags is explicitly= set to 0 (which ZFS interprets as a command to override internal default flags = with zero, rather than a request to use defaults). The NFS server propagates this EINVAL directly back to the client as NFS4ERR_INVAL, causing the entire OPEN compound to fail." Now, my trust in AI is limited, but it did give me a patch for the kernel w= hich resolved the issue for me: --- sys/fs/nfsserver/nfs_nfsdport.c.orig 2026-06-10 13:28:58.1164980= 00 -0400 +++ sys/fs/nfsserver/nfs_nfsdport.c 2026-06-12 02:48:03.969107000 -0400 @@ -1991,6 +1991,9 @@ } if (!nd->nd_repstat) { if (ndp->ni_vp =3D=3D NULL) { + if (nvap->na_vattr.va_flags =3D=3D 0) + nvap->na_vattr.va_flags =3D (u_long)VNOVAL; + nd->nd_repstat =3D VOP_CREATE(ndp->ni_dvp, &ndp->ni_vp, &ndp->ni_cnd, &nvap->na_vattr); /* For a pNFS server, create the data file on a DS.= */ That gave me some faith it might actually be right, so I figured I'd bring = it to you experts and see whether or not I'm on to something here. Either way,= I appreciate your time! I've attached the packet capture that shows the NFS conversation resulting = in NFS4ERR_INVAL. To get the Mac to use NFSv4 and navigate nfsuserd successful= ly, I set its /etc/nfs.conf to: nfs.client.mount.options =3D vers=3D4 nfs.client.default_nfs4domain =3D localdomain And the relevant rc.conf entries on the FreeBSD system are: nfsv4_server_enable=3D"YES" nfs_reserved_port_only=3D"NO" nfs_server_flags=3D"-u -t -h 192.168.4.6" nfsuserd_flags=3D"-domain localdomain" rpcbind_flags=3D"-h 192.168.4.6 -h 127.0.0.1" mountd_flags=3D"-r -S -h 192.168.4.6" (The -h options were based on advice I found to avoid them binding to the a= lias IP addresses used by jails on the same system.) --=20 You are receiving this mail because: You are the assignee for the bug.=