Skip to content

Commit

Permalink
lib/deploy: skip fallocate call when requested size is 0
Browse files Browse the repository at this point in the history
If the requested size is 0 then of course we have enough room πŸ™‚

This avoids the fallocate call returning an EINVAL.

Closes: ostreedev#2869
  • Loading branch information
dustymabe committed Jun 1, 2023
1 parent 5eacc96 commit 68d1d9a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/libostree/ostree-sysroot-deploy.c
Original file line number Diff line number Diff line change
Expand Up @@ -2446,6 +2446,14 @@ get_kernel_layout_size (OstreeSysroot *self, OstreeDeployment *deployment, guint
static gboolean
dfd_fallocate_check (int dfd, __off_t len, gboolean *out_passed, GError **error)
{
/* If the requested size is 0 then return early. Passing a 0 len to
* fallocate results in EINVAL */
if (len == 0)
{
*out_passed = TRUE;
return TRUE;
}

g_auto (GLnxTmpfile) tmpf = {
0,
};
Expand Down

0 comments on commit 68d1d9a

Please sign in to comment.