mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-26 09:47:58 +00:00
Merge pull request #4292 from m3nu/issue/4289/fix-free-space-calc
Use f_frsize instead of f_bsize to calculate free space. Fixes #4289
This commit is contained in:
commit
2db84eada0
2 changed files with 2 additions and 2 deletions
|
@ -1104,7 +1104,7 @@ def __init__(self, repository, pack=None, unpack=None, transform=None):
|
|||
|
||||
def query_size_limit(self):
|
||||
stat_fs = os.statvfs(self.basedir)
|
||||
available_space = stat_fs.f_bsize * stat_fs.f_bavail
|
||||
available_space = stat_fs.f_bavail * stat_fs.f_frsize
|
||||
self.size_limit = int(min(available_space * 0.25, 2**31))
|
||||
|
||||
def key_filename(self, key):
|
||||
|
|
|
@ -658,7 +658,7 @@ def check_free_space(self):
|
|||
logger.warning('Failed to check free space before committing: no statvfs method available')
|
||||
return
|
||||
# f_bavail: even as root - don't touch the Federal Block Reserve!
|
||||
free_space = st_vfs.f_bavail * st_vfs.f_bsize
|
||||
free_space = st_vfs.f_bavail * st_vfs.f_frsize
|
||||
logger.debug('check_free_space: required bytes {}, free bytes {}'.format(required_free_space, free_space))
|
||||
if free_space < required_free_space:
|
||||
if self.created:
|
||||
|
|
Loading…
Reference in a new issue