quotactl(2): units of reported sizes on ZFS

From: Norman Gray <gray_at_nxg.name>
Date: Tue, 28 May 2024 14:11:41 UTC
Hello, list.

[I might be asking on the wrong list, but would welcome redirection]

I'm trying to get programmatic access to read ZFS quota information, and I'm not finding my questions answered by what seem to be the relevant manpages -- specifically quotactl(2) on 14.0.

Though the manpage says that quotactl is supported only on UFS, it (now) works on ZFS filesystems, too. The response from a Q_GETQUOTA call produces numbers in units of blocks, according to ufs/ufs/quota.h internal comments, but without documenting what size those blocks are. I get the right numbers (in the sense of matching the results from zfs userspace) if I assume a block is 512B, but I can't see that written down anywhere, so don't in principle know if that's always true, or if it's something dependent on, for example, the pool's ashift value.

So, questions:

  * I'm presuming quotactl(2) is indeed now supported on ZFS, rather than this just working by accident (this does of course seem vanishingly unlikely, but I'd like a manpage to tell me this in words of one syllable).  Is that correct?
  * What's the documented way of getting the 'block size' units in which quotactl reports its results?

Both of these boil down to:

  * Is there a manpage I'm missing?

I feel sure there's an embarrassing aha! waiting for me here, because I'm looking in completely the wrong place, but I'd welcome being pointed in the right direction as tactfully as possible.

I've put in a docbug report (279249, and see also 234413) noting the apparent gap in the quotactl(2) manpage.

I also asked on one of the forums, and was pointed towards 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 manpage covering the library, nor obviously relevant comments within libzfs.h.

Best wishes,

Norman


[1] https://github.com/openzfs/zfs/tree/master


-- 
Norman Gray  :  https://nxg.me.uk