Merge pull request #2689 from jlebon/pr/ficlone-direct-payload

lib/commit: Directly use FICLONE for payload link
This commit is contained in:
Colin Walters 2022-08-15 18:33:55 -04:00 committed by GitHub
commit 9995f370d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 7 deletions

View File

@ -881,11 +881,8 @@ _try_clone_from_payload_link (OstreeRepo *self,
else
{
/* This undoes all of the previous writes; we want to generate reflinked data. */
if (ftruncate (tmpf->fd, 0) < 0)
return glnx_throw_errno_prefix (error, "ftruncate");
if (glnx_regfile_copy_bytes (fdf, tmpf->fd, -1) < 0)
return glnx_throw_errno_prefix (error, "regfile copy");
if (ioctl (tmpf->fd, FICLONE, fdf) < 0)
return glnx_throw_errno_prefix (error, "FICLONE");
return TRUE;
}

View File

@ -100,8 +100,7 @@ EOF
newcommit=$(ostree rev-parse staged-deploy)
ostree admin upgrade --stage >out.txt
test -f /run/ostree/staged-deployment
# Debating bouncing back out to Ansible for this
firstdeploycommit=$(rpm-ostree status |grep 'Commit:' |head -1|sed -e 's,^ *Commit: *,,')
firstdeploycommit=$(rpm-ostree status --json | jq -r .deployments[0].checksum)
assert_streq "${firstdeploycommit}" "${newcommit}"
# Cleanup
rpm-ostree cleanup -rp