Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 05 Jun 2024 09:48:55 +0100
From:      Norman Gray <gray@nxg.name>
To:        =?utf-8?q?Dag-Erling_Sm=C3=B8rgrav?= <des@FreeBSD.org>
Cc:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: quotactl(2) units of reported sizes on ZFS
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>

next in thread | previous in thread | raw e-mail | index | archive | help

Dag-Erling, hello.

On 4 Jun 2024, at 23:17, Dag-Erling Sm=C3=B8rgrav wrote:

> Norman Gray <gray@nxg.name> 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 <sys/statvfs.h>) 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 <https://pub=
s.opengroup.org/onlinepubs/9699919799/toc.htm>
[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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?28D77DB4-B8F1-4680-8891-F3CA454FC9F4>