From nobody Mon Jul 01 08:40:15 2024 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 4WCKHb2LWcz5Psc1 for ; Mon, 01 Jul 2024 08:40:27 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WCKHb1rqqz52sV for ; Mon, 1 Jul 2024 08:40:27 +0000 (UTC) (envelope-from theraven@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719823227; 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=SbmUNSXl9TKLVvk0n6+iRdYYpptn/IfZ7/sz1928i+0=; b=VJRXAR3ICJw9bdQhr2VDp3iedvslkxWp71+PV9+41K/EHWHIJyIpVALQ2tzPDRl9Fhc5LN CrbaPo9r78K43LM8v62TFtF1s/dBhHkm7l3dWA3L+beEVUn9Z9lbT1JnGwvMp2xdroH2mj hFuIvde9ps9koi7wqKClyXRFZWtyuzh+ve1+T0GwOnMEc7IZoGq8lr53Ix6F5iN2c6wpKc dZmswjVXJ1L8jkc6BVFaM39F0rQBWBE7suEDHAURw1f20i/QwI6QmWUrvysoJT9guVG1pk kxYtNkTrBO4UcIgC4xK1WlphC+FBMykRA9961kkbgjqpaq7Z6rfeHTQaongw6Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1719823227; a=rsa-sha256; cv=none; b=jZHGyx/XqzSO3l8RTUc59yrQWBm3ffpEG6fcykrTO3oPssEKzk/caysw/ME1jccz7Kp5Mj 4dycXy3hBUWdqdYDIlAdF2iC886xqoOAc1QInJ+SBgV9EFzORjxqH3Z/H3FNekahfsm7z2 9avmI5N+NzUI2vt5EHd28/UNW8dFFGTnXP3dQyUoPf0rIN/3e67FCx3rqJsCwn+RUUHPrj L1lxL6wWR16XnSLtEBCilzk+FJtdAZNLJdfe23VZ8RXrZQ0+p5rUzjF+YdAxjXb4LH6qEA efbJXmhFWkk0L3PDT35AHuIVq9GIVyFbHjTozyX9K4wpfuwQ013O+8Sh486fIQ== 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=1719823227; 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=SbmUNSXl9TKLVvk0n6+iRdYYpptn/IfZ7/sz1928i+0=; b=waFINE5z5r3jYEiMLCfwnSV2oV54J0XWxn86hYnCGF20M6jkfdLRMASP6n4lceZCLBrhNV OLEXIrRYl8W6IB6dIZCyyNXZaFDCxTQjvxjrwzMmu/zKXWjeNKUoma8FPceavYvZhhsSHv XBETOUJv7LsC8kLIG8Zyb7SuWFOUxLpDPjCd+YOs1YjL4llKXMF0Zr+dWfK0YMG4/0qlxf b2UiXUJPlbPWej4ZamYVwHA4yomWIXr+Gf4b5tYPyprCqnPAadc77rUap09YqIf/Kvyikg 97V39v7eKOQqjgNRgwgdQOb3eS3VT51zkkexiOcfLXPhGAX6IzBc4t+O6T0cAA== Received: from smtp.theravensnest.org (smtp.theravensnest.org [45.77.103.195]) (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) (Authenticated sender: theraven) by smtp.freebsd.org (Postfix) with ESMTPSA id 4WCKHb1GKPzGd4 for ; Mon, 1 Jul 2024 08:40:27 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from smtpclient.apple (host86-159-181-184.range86-159.btcentralplus.com [86.159.181.184]) by smtp.theravensnest.org (Postfix) with ESMTPSA id 7675CB954 for ; Mon, 1 Jul 2024 09:40:26 +0100 (BST) From: David Chisnall Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 (Mac OS X Mail 16.0 \(3774.600.62\)) Subject: Please can we do something about programmatic interfaces to ZFS? Message-Id: <8C7859E3-A72E-4852-AF43-DFD0ABA5D270@FreeBSD.org> Date: Mon, 1 Jul 2024 09:40:15 +0100 To: FreeBSD Current X-Mailer: Apple Mail (2.3774.600.62) Hi, Since updating to 15-CURRENT, I have been unable to get some existing = code that used libzfs_core to take snapshots. There are a lot of = reasons that this could have broken and it=E2=80=99s hard to track it = down: - We ship both libnv and libnvpair. These define the same data = structure but with different APIs and are incompatible. I believe libnv = can create the serialised data structures that the ZFS ioctls expect. - We don=E2=80=99t install headers for libnvpair or libzfs_core (or = libzfs) and so any code using these has to either depend on things in = the src tree (which depend on OpenSolaris headers that are incompatible = with FreeBSD ones, so must be in separate compilation units) or provide = its own definitions, which may get out of sync with the libraries. - We don=E2=80=99t provide any documentation of the underlying ZFS = ioctls (and there is some code that suggests that these vary between = platforms), and so the *only* API for interacting with ZFS is = libzfs_core. - The APIs in libzfs_core are also poorly documented. This makes it incredibly difficult to interact with ZFS via anything = other than the `zfs` command-line tool. When things break, I have no = idea which of these layers caused the breakage. David