Skip to content
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

[825] Incorrect disk space calculation inside docker container #828

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

archeoss
Copy link
Contributor

@archeoss archeoss commented Aug 9, 2023

Closes #825

Note 1: usage of frsize instead of bsize seems to do nothing (at least on Linux). Needs to be tested on some Mac machine, where it's first occured. Also this change about frsize needs to be done after #823 will be merged, since that function was rewritten there

@archeoss archeoss linked an issue Aug 9, 2023 that may be closed by this pull request
@archeoss archeoss changed the title redo disks mapping [825] Incorrect disk space calculation inside docker container Aug 9, 2023
@archeoss archeoss requested a review from ikopylov August 9, 2023 23:27
@archeoss archeoss marked this pull request as draft August 10, 2023 11:04
@archeoss archeoss marked this pull request as ready for review August 15, 2023 12:55
@archeoss archeoss marked this pull request as draft August 20, 2023 13:13
@archeoss archeoss marked this pull request as ready for review August 20, 2023 14:21
@ikopylov
Copy link
Member

Please, do not forget to fix space calculation from results of statvfs syscall. It should use frsize instead of bsize

if dev_path
.iter()
.filter(|(dev, _)| *dev == metadata.dev())
.any(|(_, path)| disk.mount_point().file_name() == path.file_name())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not correct. We should check that disk.mount_point() is a prefix of path. Example: mount_point = "/opt/disk1/", path = "/opt/disk1/bob". Use starts_with function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect disk space calculation inside docker container
2 participants