From 1b1655360088c1b0b9681f1f8997c925fc0f7a94 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 8 Apr 2014 17:31:17 -0400 Subject: [PATCH] checkout: fsync() directory on checkouts We want to be really sure that our deployment roots have hit the disk. --- src/libostree/ostree-repo-checkout.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/libostree/ostree-repo-checkout.c b/src/libostree/ostree-repo-checkout.c index 126545de..7bf83289 100644 --- a/src/libostree/ostree-repo-checkout.c +++ b/src/libostree/ostree-repo-checkout.c @@ -657,6 +657,16 @@ checkout_tree_at (OstreeRepo *self, } } + /* Finally, fsync to ensure all entries are on disk. Ultimately + * this should be configurable for the case where we're constructing + * buildroots. + */ + if (fsync (destination_dfd) == -1) + { + ot_util_set_error_from_errno (error, errno); + goto out; + } + ret = TRUE; out: if (destination_dfd != -1)