Problem with how quotas are calculated #82

Closed
opened 2023-07-07 16:36:45 +02:00 by mtrossevin · 1 comment
Owner

It would seems that web-add.sh (and therefor everything else) assume that quota are in KiB when they are rather explicitly in filesystem blocks, whose size is depending on the FS and server, but are generally 4KiB in size nowadays (the default was originally 512B then it went up to 1024B then 4096KiB).

Most notably, when setting quota in create_www_account() for web-add.sh quota given on the command line in GiB (1048576 KiB) should be divided by (1024*1024/4) or 262144 instead of (1024*1024) in order to get the quota in blocks as expected by setquota.

It honestly should take the size of block from the filesystem header instead of hard-coding it, so as not to have this problem in the future.

It would seems that web-add.sh (and therefor everything else) assume that quota are in KiB when they are rather explicitly in **filesystem blocks**, whose size is depending on the FS and server, but are generally 4KiB in size nowadays (the default was originally 512B then it went up to 1024B then 4096KiB). Most notably, when setting quota in `create_www_account()` for web-add.sh quota given on the command line in GiB (1048576 KiB) should be divided by `(1024*1024/4)` or `262144` instead of `(1024*1024)` in order to get the quota in blocks as expected by `setquota`. It honestly should take the size of block from the filesystem header instead of hard-coding it, so as not to have this problem in the future.
mtrossevin added the
Bug
label 2023-11-22 16:33:16 +01:00
Author
Owner

After rereading the documentation it is fine actually :

Block usage and limits are reported and interpreted as multiples of kibibyte (1024 bytes) blocks by default. Symbols K, M, G, and T can be appended to numeric value to express kibibytes, mebibytes, gibibytes, and tebibytes.
After rereading the documentation it is fine actually : ``` Block usage and limits are reported and interpreted as multiples of kibibyte (1024 bytes) blocks by default. Symbols K, M, G, and T can be appended to numeric value to express kibibytes, mebibytes, gibibytes, and tebibytes. ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: evolix/evoadmin-web#82
No description provided.