-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Use quota in volume size option #295
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but please see my comments.
# Test will only succeed if the available space is more than 1GiB | ||
# | ||
# To run this test you need to add the following lines to /etc/sudoers.d/saunafstest: | ||
# | ||
# saunafstest ALL = NOPASSWD: /usr/bin/tee /tmp/SaunaFS-autotests/mnt/sfs* | ||
# | ||
# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding this to the setup machine script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was copied from another test, so it should be there (the tee
line in sudoers.d).
src/mount/fuse/mount_config.cc
Outdated
" -o usequotainvolumesize=0|1 replace normal volume size with the space hard limit " | ||
"of the user specific quota (if assigned) when set to 1 (default: %u)\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it consider quota for groups?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to consider it, even coded the idea but the context coming from fuse layer passes a wrong gid
. Have no idea why.
@@ -687,6 +688,34 @@ struct statvfs statfs(Context &ctx, Inode ino) { | |||
} | |||
(void)ino; | |||
fs_statfs(&totalspace,&availspace,&trashspace,&reservedspace,&inodes); | |||
if (gUseQuotaInVolumeSize) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applications can trigger a surprisingly high number of statfs (even bigger in Windows). Consider to cache the final quota value for a short time (1-5 seconds).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I gave it some thought and the idea could be extended to the whole statfs output because the quota result (specially user's used space) could change at the same pace of the whole storage used space.
I have the cache for the whole statfs and an option to tune it, and also added it to the tweaks, so it could be activated in runtime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
tests/test_suites/ShortSystemTests/test_use_quota_in_volume_size.sh
Outdated
Show resolved
Hide resolved
This commit adds a new option to the client which allows users to see as the total space of the drive the assigned quota to themselves if enabled. This option is also added to the tweaks hidden file. Signed-off-by: Dave <[email protected]>
e9b5207
to
37c6ce4
Compare
The statfs syscall output could be cached for each user requesting it. The main goal is to prevent a flooding of unnecessary calls in certain workloads. The commit includes the option to tune it and adding it to the tweaks hidden file parameters. Signed-off-by: Dave <[email protected]>
This commit adds the test_use_quota_in_volume_size to the ShortSystemTests suite. Signed-off-by: Dave <[email protected]> kk2
The following changes are proposed: - enclose limit_glibc_malloc_arenas option and its default value in Linux specific parts of the code. - reduce the number of ifdef/endif processor directives by consolidating the platform specific lines of code. The goal of this commit is to increase readability of this part of the code. Signed-off-by: Dave <[email protected]>
37c6ce4
to
05e33c2
Compare
The following changes are proposed:
usequotainvolumesize
to display the user specific quota instead of the storage total size. This option is also added to tweaks hidden file.statfscachetimeout
to tune the statfs output caching, it is disabled by default. This option is also added to tweaks hidden file.Signed-off-by: Dave [email protected]