From ef0057299945ff1d5e687c46ba65eb470263d3d5 Mon Sep 17 00:00:00 2001 From: Vadim Rutkovsky Date: Wed, 4 Jun 2014 01:40:32 +0200 Subject: [PATCH] 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 --- src/libostree/ostree-repo-checkout.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/libostree/ostree-repo-checkout.c b/src/libostree/ostree-repo-checkout.c index 7bf83289..417e11f6 100644 --- a/src/libostree/ostree-repo-checkout.c +++ b/src/libostree/ostree-repo-checkout.c @@ -661,10 +661,13 @@ checkout_tree_at (OstreeRepo *self, * this should be configurable for the case where we're constructing * buildroots. */ - if (fsync (destination_dfd) == -1) + if (!self->disable_fsync) { - ot_util_set_error_from_errno (error, errno); - goto out; + if (fsync (destination_dfd) == -1) + { + ot_util_set_error_from_errno (error, errno); + goto out; + } } ret = TRUE;