Skip to content

Commit

Permalink
lib/deploy: Add 1M margin in early prune space check
Browse files Browse the repository at this point in the history
There are a few things the estimator doesn't account for, e.g. writing
the new BLS entries. Rather than trying to perfect it (since I think we
should change approach entirely -- see previous commit message), just
add a 1M margin to the space check.
  • Loading branch information
jlebon committed Jan 4, 2024
1 parent 5175ae5 commit 39ff27f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/libostree/ostree-sysroot-deploy.c
Original file line number Diff line number Diff line change
Expand Up @@ -2541,6 +2541,10 @@ dfd_fallocate_check (int dfd, off_t len, gboolean *out_passed, GError **error)
if (!glnx_open_tmpfile_linkable_at (dfd, ".", O_WRONLY | O_CLOEXEC, &tmpf, error))
return FALSE;

/* add 1M as a large safety margin to account for any files also written to
* /boot that aren't counted, like the BLS entry file */
len += 1 << 20;

*out_passed = TRUE;
/* There's glnx_try_fallocate, but not with the same error semantics. */
if (TEMP_FAILURE_RETRY (fallocate (tmpf.fd, 0, 0, len)) < 0)
Expand Down

0 comments on commit 39ff27f

Please sign in to comment.