[BlueOnyx:19835] Re: 5209R User and Site Quota display issue

Michael Stauber mstauber at blueonyx.it
Thu Jul 14 11:27:23 -05 2016


Hi Dirk,

> Am I the only one with this issue?

Probably not. But you're the first one to mention it. ;-)

This part of the code is in base-alpine and has been around since 2014
when I ported it over from similar Aventurin{e} routines. The functions
simplify_numbers() and unsimplify_numbers() were introduced to make
large numbers more human readable and to show a unit at the end.

Naturally: Some rounding takes place during the transformation. So if
you for example set the Quota to "1555M", it will show as "1.5G"
afterwards. If you then save yet again, it will be set to "1500M". This
isn't really perfect.

What I certainly need to check is the punctuation/comma. Offhand I don't
recall if or how that works. It probably doesn't allow either a comma or
a dot and only takes integers and optionally a character for the unit at
the end ("B", "M", "G" or "T").

But when you set 1300M in your example it seems to have worked fine:

Disk quotas for user ab_cb (uid 1122):
     Filesystem  blocks   quota   limit   grace   files   quota   limit
  grace
/dev/mapper/VolGroup00-home
                1024900  1331200 1332224             182       0       0

"blocks" is the current usage. Which means he's currently using 1GB.

"quota" is how much he might be able to use. That's your 1.3GB that you
set via "1300M". Limit is the total cutoff-value and it's just a few
blocks higher. To me that looks good.

So when entering the amount of diskspace you should use integers for
now. Instead of setting "1.3G" use "1300M" instead and it ought to work
fine.

In the longer haul I'll see if I can allow fractions. The problem here
is that different localizations have different decimal separators. For
example: In German we use the comma, in English it would be a dot.

-- 
With best regards

Michael Stauber



More information about the Blueonyx mailing list