From 4f794bbeea89c8933b02a4f5d0910ce248f29583 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Tue, 24 Dec 2024 22:39:21 +0100 Subject: [PATCH] config: reject additional_free_space < 10M, fixes #6066 Doesn't mean that 10M is very helpful in out of space conditions, but avoids wrong unit assumptions as in #6066. --- src/borg/archiver.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/borg/archiver.py b/src/borg/archiver.py index af8937596..491e038ca 100644 --- a/src/borg/archiver.py +++ b/src/borg/archiver.py @@ -1924,6 +1924,11 @@ class Archiver: minimum = parse_file_size('10M') if wanted != 0 and wanted < minimum: raise ValueError('Invalid value: storage_quota < 10M') + elif name == 'additional_free_space': + wanted = parse_file_size(value) + minimum = parse_file_size('10M') + if wanted != 0 and wanted < minimum: + raise ValueError('Invalid value: additional_free_space < 10M') elif name == 'max_segment_size': if parse_file_size(value) >= MAX_SEGMENT_SIZE_LIMIT: raise ValueError('Invalid value: max_segment_size >= %d' % MAX_SEGMENT_SIZE_LIMIT)