Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 03 Jun 2024 17:26:02 +0100
From:      Norman Gray <gray@nxg.name>
To:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   quotactl(2) units of reported sizes on ZFS
Message-ID:  <432AE47C-1502-4BFA-B680-7DAF6DDC601A@nxg.name>

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

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?432AE47C-1502-4BFA-B680-7DAF6DDC601A>