From nobody Mon Jun 03 16:26:02 2024 X-Original-To: freebsd-questions@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 4VtJxs6S3Vz5Mnnw for ; Mon, 03 Jun 2024 16:26:09 +0000 (UTC) (envelope-from gray@nxg.name) Received: from mx2.mythic-beasts.com (mx2.mythic-beasts.com [IPv6:2a00:1098:0:82:1000:0:2:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4VtJxp6pZNz45gn for ; Mon, 3 Jun 2024 16:26:06 +0000 (UTC) (envelope-from gray@nxg.name) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=nxg.name header.s=mythic-beasts-k1 header.b=u3Q7Ewk6; dmarc=none; spf=pass (mx1.freebsd.org: domain of gray@nxg.name designates 2a00:1098:0:82:1000:0:2:1 as permitted sender) smtp.mailfrom=gray@nxg.name DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nxg.name; s=mythic-beasts-k1; h=Date:Subject:To:From; bh=Qu/NNzYrATneuE0au6I0ffzKL8RRRTtxaRprY880fAE=; b=u3Q7Ewk6xNs9f0lc0XALY9wF3N VZXE7V1KIFDD5v5sZnYabuS0ShYkzHQg2k4Otg34WVt0sJav+iTC/BZss2yqRDZJH4iYCTG1JJA1b lA4i3xzWDmznGbyP1udI3fbHlEazGhsuj7/GLgVrLkA057H2FK0Vqq1hY/zI7xKdm0EIODS0wgc0R 9hY1+3SNuL7+XDpq536Y11fSamnCNEiXWfimtjLSwFPDOqAxGkfnnVYpl3J1DrkTXrt+B1MySYaBH Zwhm/dTv+N8YaLwcrhFhQ0eS37I80jqf82M0l8DKEq48eOMT4xAAk3XZaY6gZ5XdKHM1LPiSd5vHe 16BVPktg==; Received: by mailhub-hex-d.mythic-beasts.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sEAVY-00G9Ld-S2; Mon, 03 Jun 2024 17:26:05 +0100 From: Norman Gray To: FreeBSD Questions Subject: quotactl(2) units of reported sizes on ZFS Date: Mon, 03 Jun 2024 17:26:02 +0100 X-Mailer: MailMate (1.14r5964) Message-ID: <432AE47C-1502-4BFA-B680-7DAF6DDC601A@nxg.name> List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-questions@freebsd.org Sender: owner-freebsd-questions@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-BlackCat-Spam-Score: 24 X-Spam-Status: No, score=2.4 X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.60 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; R_MISSING_CHARSET(0.50)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1098:0:82:1000:0:2:0/112]; R_DKIM_ALLOW(-0.20)[nxg.name:s=mythic-beasts-k1]; RCVD_IN_DNSWL_MED(-0.20)[2a00:1098:0:82:1000:0:2:1:from]; MIME_GOOD(-0.10)[text/plain]; ONCE_RECEIVED(0.10)[]; ASN(0.00)[asn:44684, ipnet:2a00:1098::/32, country:GB]; RCVD_COUNT_ONE(0.00)[1]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_TRACE(0.00)[nxg.name:+]; MLMMJ_DEST(0.00)[freebsd-questions@freebsd.org]; TO_DN_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; DMARC_NA(0.00)[nxg.name]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_ALL(0.00)[] X-Rspamd-Queue-Id: 4VtJxp6pZNz45gn Hello, list. The call quotactl(2) reports quota sizes in units of 'blocks', but how bi= g is a block? Traditionally, of course, the answer is 512B, and when I use quotactl(2) = to Q_GETQUOTA for a user, with reference to a ZFS filesystem, the results= match the output of `zfs userspace` if I assume that block size. But I can't see that written down anywhere, neither in the quotactl manpa= ge, nor in /usr/include/ufs/ufs/quota.h. Also, I wouldn't be at all surp= rised if quotas were reported in different 'block sizes', on differently-= configured zpools (for example with a different ashift value), so the ass= umption that 'block=3D512B' could be right on one machine/filesystem but = wrong on another. So how big is 'a block', when interpreting the result of quotactl(2)? I've found this question weirdly hard to answer, asking on two of the for= ums and another freebsd.org list. I'm aware of libzfs, but I can't find any documentation on that, either. = I can see libzfs in the ZFS repo [1], but there doesn't seem to be a man= page covering the library, nor obviously relevant comments within /usr/in= clude/libzfs.h. I can see a mention of zfs_prop_get_userquota in that he= ader file (I should probably be using that, rather than quotactl()), but.= =2E. no documentation. (There is the separate anomaly that the quotactl(2) manpage says that it = is only supported on UFS, but it manifestly also works without error on a= ZFS filesystem.) Can anyone shed some light? Best wishes, Norman [1] https://github.com/openzfs/zfs/tree/master -- = Norman Gray : https://nxg.me.uk