Skip to content
Snippets Groups Projects
Commit 6b7f7358 authored by Valentin David's avatar Valentin David
Browse files

Use f_bavail to query available space. Not f_bfree.

f_bfree space might not be usable. In practice we see failures in big
disks because f_bfree is over 2GB and f_bavail is 0. We get ENOSPC if
writing on disk then.
parent 2a8a3b19
No related branches found
No related tags found
Loading
......@@ -422,7 +422,7 @@ def _clean_up_cache(cas, object_size):
# which mounts the repo
stats = os.statvfs(cas.casdir)
buffer_ = int(2e9) # Add a 2 GB buffer
free_disk_space = (stats.f_bfree * stats.f_bsize) - buffer_
free_disk_space = (stats.f_bavail * stats.f_bsize) - buffer_
total_disk_space = (stats.f_blocks * stats.f_bsize) - buffer_
if object_size > total_disk_space:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment