Honor disable_fsync during checkout also

Finally, fsync to ensure all entries are on disk, unless disabled.
 We support disabling this for cases like server-side buildroot
 construction where we don't need to be robust against power loss
This commit is contained in:
Vadim Rutkovsky 2014-06-04 01:40:32 +02:00
parent cb43d2942f
commit ef00572999
1 changed files with 6 additions and 3 deletions

View File

@ -661,11 +661,14 @@ checkout_tree_at (OstreeRepo *self,
* this should be configurable for the case where we're constructing * this should be configurable for the case where we're constructing
* buildroots. * buildroots.
*/ */
if (!self->disable_fsync)
{
if (fsync (destination_dfd) == -1) if (fsync (destination_dfd) == -1)
{ {
ot_util_set_error_from_errno (error, errno); ot_util_set_error_from_errno (error, errno);
goto out; goto out;
} }
}
ret = TRUE; ret = TRUE;
out: out: