[ostree] checkout: fsync() directory on checkouts
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ostree] checkout: fsync() directory on checkouts
- Date: Fri, 11 Apr 2014 22:45:05 +0000 (UTC)
commit 1b1655360088c1b0b9681f1f8997c925fc0f7a94
Author: Colin Walters <walters verbum org>
Date: Tue Apr 8 17:31:17 2014 -0400
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 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/libostree/ostree-repo-checkout.c b/src/libostree/ostree-repo-checkout.c
index 126545d..7bf8328 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)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]