From nobody Wed Jun 05 08:48:55 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 4VvLjX1gZ9z5MBJ5 for ; Wed, 05 Jun 2024 08:49:04 +0000 (UTC) (envelope-from gray@nxg.name) Received: from mx1.mythic-beasts.com (mx1.mythic-beasts.com [IPv6:2a00:1098:0:86: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 4VvLjW6jMlz4L7q; Wed, 5 Jun 2024 08:49:03 +0000 (UTC) (envelope-from gray@nxg.name) Authentication-Results: mx1.freebsd.org; none 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=e7JV6PbU13NF0qUtLVINhmAI11UNq6/cqh3yXP1esl0=; b=4VDS0hQdCgN6A7dPjS+dReZRwv NGDFjDlBPCOSZjMxIz6/BDxTJBDvOE+vQZw5kPUL+OzrooXtFK24jmvgGHrk1qRPFtpdrMlX8v4xU 2JAs6z5meZWItYbTdvfLLIFPHWRMyYX/BPgn/4VQsUC7y/tjYKEaPtxUmIQpma67jnAQcn9yIlOFb cp4upndfyo97X2Di4FIOhRUbr/VHmpnrim2d2syqdKkcVTDYDFPWjSPoMBv/bW8SrKNhoLy0+FV5h Hw0wuJFHrJTM7GmldHYopl+qPkCloq7d+raa8bvX/39WBotuKaDXAnZoINDXkgUsJyy5K7odnHq3G DPmI/EXg==; Received: by mailhub-cam-d.mythic-beasts.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sEmKL-00Dhii-Jk; Wed, 05 Jun 2024 09:49:02 +0100 From: Norman Gray To: =?utf-8?q?Dag-Erling_Sm=C3=B8rgrav?= Cc: FreeBSD Questions Subject: Re: quotactl(2) units of reported sizes on ZFS Date: Wed, 05 Jun 2024 09:48:55 +0100 X-Mailer: MailMate (1.14r5964) Message-ID: <28D77DB4-B8F1-4680-8891-F3CA454FC9F4@nxg.name> In-Reply-To: <861q5c4akw.fsf@ltc.des.dev> References: <432AE47C-1502-4BFA-B680-7DAF6DDC601A@nxg.name> <861q5c4akw.fsf@ltc.des.dev> 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; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BlackCat-Spam-Score: 0 X-Spam-Status: No, score=-0.1 X-Spamd-Bar: ---- 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)[]; ASN(0.00)[asn:44684, ipnet:2a00:1098::/32, country:GB] X-Rspamd-Queue-Id: 4VvLjW6jMlz4L7q Dag-Erling, hello. On 4 Jun 2024, at 23:17, Dag-Erling Sm=C3=B8rgrav wrote: > Norman Gray writes: >> The call quotactl(2) reports quota sizes in units of 'blocks', but how= >> big is a block? Traditionally, of course, the answer is 512B, [...] > > You could simply have stopped there, it's a POSIX requirement. That's an interesting direction to come from -- thanks! Can you point to chapter and verse, though? Looking at [1], and specific= ally the specification of the contents of sys/stat.h [2], I find: > The unit for the st_blocks member of the stat structure is not defined = within POSIX.1-2017. In some implementations it is 512 bytes. It may diff= er on a file system basis. There is no correlation between values of the = st_blocks and st_blksize, and the f_bsize (from ) structur= e members. That's stat.h, of course, rather than anything to do with quotas specific= ally. But POSIX doesn't mention quotas (not surprisingly), so if the quo= tactl manpage were going to silently adopt a POSIX unit definition, it's = stat.h I'd expect it to come from. Individual utilities -- for example `ulimit` [3] or `df` -- document that= one or other argument is in units of 512B 'blocks', but that's a user-in= terface issue. Best wishes, Norman [1] The Open Group Base Specifications Issue 7, 2018 edition [2] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_stat.h.= html [3] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/ulimit.htm= l -- = Norman Gray : https://nxg.me.uk