[ostree] pull: Delete processed delta parts



commit ebd03216a167e020a577a9f47ee1df3e45da8533
Author: Colin Walters <walters verbum org>
Date:   Wed Jan 14 22:18:00 2015 -0500

    pull: Delete processed delta parts
    
    Otherwise they stay around until a much later GC.

 src/libostree/ostree-repo-pull.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c
index 0c4e22b..b5b780e 100644
--- a/src/libostree/ostree-repo-pull.c
+++ b/src/libostree/ostree-repo-pull.c
@@ -857,6 +857,12 @@ static_deltapart_fetch_on_complete (GObject           *object,
     delta_data = g_mapped_file_get_bytes (mfile);
     g_mapped_file_unref (mfile);
 
+    /* Unlink now while we're holding an open fd, so that on success
+     * or error, the file will be gone.  This is particularly
+     * important if say we hit e.g. ENOSPC.
+     */
+    (void) unlinkat (pull_data->tmpdir_dfd, temp_path, 0); 
+
     _ostree_static_delta_part_execute_async (pull_data->repo,
                                              fetch_data->objects,
                                              delta_data,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]