lib/repo: Ensure min-free-space* config value doesn't overflow

when converted to bytes

In a subsequent commit, we add a public API to read the value of
min-free-space-* value in bytes. The value for free space check
is enforced in terms of block size instead of bytes. Therefore,
for consistency we check while preparing the transaction that the
value doesn't overflow when converted to bytes.

https://phabricator.endlessm.com/T23694

Closes: #1715
Approved by: cgwalters
This commit is contained in:
Umang Jain authored and Atomic Bot committed 2018-09-04 21:31:33 +00:00
1 parent 74bdf7e173
commit 3814d075cb
2 files changed
+20 -9

No files matched your search

+1
View File
@@ -153,6 +153,7 @@ struct OstreeRepo {
gid_t target_owner_gid;
guint min_free_space_percent; /* See the min-free-space-percent config option */
guint64 min_free_space_mb; /* See the min-free-space-size config option */
guint64 reserved_blocks;
gboolean cleanup_stagedir;
guint test_error_flags; /* OstreeRepoTestErrorFlags */