[ostree/wip/fsync: 3/11] checkout: fsync() directory on checkouts



commit 650adab3bcd6a9d97ef5d7c837f7750511e2b407
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]