lib/commit: Fix EBADF with GENERATE_SIZES option for commit
Regression from previous tmpfile refactoring; unfortunately the `OSTREE_REPO_COMMIT_MODIFIER_FLAGS_GENERATE_SIZES` option only has coverage via gjs currently. Might expose it via the cmdline in a later option, but in the big picture the idea was that this data is better kept in static deltas. Closes: https://github.com/ostreedev/ostree/issues/1014 Closes: #1016 Approved by: jlebon
This commit is contained in:
parent
ebbd0b3ce6
commit
f9f7d55e79
|
|
@ -734,15 +734,6 @@ write_content_object (OstreeRepo *self,
|
|||
}
|
||||
else
|
||||
{
|
||||
/* This path is for regular files */
|
||||
if (!commit_loose_regfile_object (self, actual_checksum, &tmpf,
|
||||
uid, gid, mode,
|
||||
xattrs,
|
||||
cancellable, error))
|
||||
return glnx_prefix_error (error, "Writing object %s.%s", actual_checksum,
|
||||
ostree_object_type_to_string (OSTREE_OBJECT_TYPE_FILE));
|
||||
}
|
||||
|
||||
/* Update size metadata if configured */
|
||||
if (indexable && object_file_type == G_FILE_TYPE_REGULAR)
|
||||
{
|
||||
|
|
@ -754,6 +745,15 @@ write_content_object (OstreeRepo *self,
|
|||
repo_store_size_entry (self, actual_checksum, unpacked_size, stbuf.st_size);
|
||||
}
|
||||
|
||||
/* This path is for regular files */
|
||||
if (!commit_loose_regfile_object (self, actual_checksum, &tmpf,
|
||||
uid, gid, mode,
|
||||
xattrs,
|
||||
cancellable, error))
|
||||
return glnx_prefix_error (error, "Writing object %s.%s", actual_checksum,
|
||||
ostree_object_type_to_string (OSTREE_OBJECT_TYPE_FILE));
|
||||
}
|
||||
|
||||
/* Update statistics */
|
||||
g_mutex_lock (&self->txn_stats_lock);
|
||||
self->txn_stats.content_objects_written++;
|
||||
|
|
|
|||
Loading…
Reference in New Issue