Merge pull request #2871 from dustymabe/dusty-fallocate-einval

lib/deploy: skip fallocate call when requested size is 0
This commit is contained in:
Colin Walters 2023-06-01 10:34:13 -04:00 committed by GitHub
commit 67929db1dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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,
};