diff --git a/.gitignore b/.gitignore index 0e5fba7..b658d63 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/ostree-2016.5.tar.xz +SOURCES/ostree-2016.7.tar.xz diff --git a/.ostree.metadata b/.ostree.metadata index a6bd2f6..050af2c 100644 --- a/.ostree.metadata +++ b/.ostree.metadata @@ -1 +1 @@ -07eef2576680daa2bd8c7fd190462eb400a013c8 SOURCES/ostree-2016.5.tar.xz +5309d30b5550ae55e75120695d33df129705609f SOURCES/ostree-2016.7.tar.xz diff --git a/SOURCES/0001-pull-Ensure-we-always-process-queue-only-from-main-t.patch b/SOURCES/0001-pull-Ensure-we-always-process-queue-only-from-main-t.patch deleted file mode 100644 index 63a04d8..0000000 --- a/SOURCES/0001-pull-Ensure-we-always-process-queue-only-from-main-t.patch +++ /dev/null @@ -1,186 +0,0 @@ -From 0271ce020f3e8c30044632f4e4bfa673b051f233 Mon Sep 17 00:00:00 2001 -From: Colin Walters -Date: Thu, 16 Jun 2016 22:16:27 -0400 -Subject: [PATCH] pull: Ensure we always process queue only from main thread - -I was easily reproducing a hang on pulls with thousands of requests on -current git master. The initial symptom seemed to be that there are -multiple code paths where we don't invoke -`session_thread_process_pending_queue()`. We really need to do -that any time we remove something from the outstanding queue, -to ensure it gets filled again. - -A further issue is that we were tying the lifecycle of the pending -object to the `GTask`, but the task could be unref'd from the main -thread (via a `GSource` on the main thread), and that introduced -threadsafety issues, because the hash table and other data suddenly -could be concurrently modified. - -Both of these need to be fixed together. First, we introduce -`Arc`, and ensure that both the main and worker threads hold -references. - -Second, we ensure that we re-process the queue *immediately* whenever -a task is done, inside the worker thread, rather than doing it -incidentally via an unref. This architecture is quite similar to what -the outside pull code is doing. ---- - src/libostree/ostree-fetcher.c | 55 ++++++++++++++++++++++++++++++++++++------ - 1 file changed, 47 insertions(+), 8 deletions(-) - -diff --git a/src/libostree/ostree-fetcher.c b/src/libostree/ostree-fetcher.c -index d956d95..313df6a 100644 ---- a/src/libostree/ostree-fetcher.c -+++ b/src/libostree/ostree-fetcher.c -@@ -67,7 +67,12 @@ typedef struct { - guint64 total_downloaded; - } ThreadClosure; - -+static void -+session_thread_process_pending_queue (ThreadClosure *thread_closure); -+ - typedef struct { -+ volatile int ref_count; -+ - ThreadClosure *thread_closure; - SoupURI *uri; - -@@ -186,10 +191,22 @@ pending_task_compare (gconstpointer a, - (priority_a < priority_b) ? -1 : 1; - } - -+static OstreeFetcherPendingURI * -+pending_uri_ref (OstreeFetcherPendingURI *pending) -+{ -+ g_return_val_if_fail (pending != NULL, NULL); -+ g_return_val_if_fail (pending->ref_count > 0, NULL); -+ -+ g_atomic_int_inc (&pending->ref_count); -+ -+ return pending; -+} -+ - static void --pending_uri_free (OstreeFetcherPendingURI *pending) -+pending_uri_unref (OstreeFetcherPendingURI *pending) - { -- g_hash_table_remove (pending->thread_closure->outstanding, pending); -+ if (!g_atomic_int_dec_and_test (&pending->ref_count)) -+ return; - - g_clear_pointer (&pending->thread_closure, thread_closure_unref); - -@@ -331,8 +348,7 @@ session_thread_process_pending_queue (ThreadClosure *thread_closure) - pending = g_task_get_task_data (task); - cancellable = g_task_get_cancellable (task); - -- /* pending_uri_free() removes this. */ -- g_hash_table_add (thread_closure->outstanding, pending); -+ g_hash_table_add (thread_closure->outstanding, pending_uri_ref (pending)); - - soup_request_send_async (pending->request, - cancellable, -@@ -540,7 +556,7 @@ _ostree_fetcher_constructed (GObject *object) - self->thread_closure->tmpdir_dfd = -1; - self->thread_closure->tmpdir_lock = empty_lockfile; - -- self->thread_closure->outstanding = g_hash_table_new (NULL, NULL); -+ self->thread_closure->outstanding = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify)pending_uri_unref); - self->thread_closure->output_stream_set = g_hash_table_new_full (NULL, NULL, - (GDestroyNotify) NULL, - (GDestroyNotify) g_object_unref); -@@ -743,6 +759,18 @@ on_stream_read (GObject *object, - gpointer user_data); - - static void -+remove_pending_rerun_queue (OstreeFetcherPendingURI *pending) -+{ -+ /* Hold a temporary ref to ensure the reference to -+ * pending->thread_closure is valid. -+ */ -+ pending_uri_ref (pending); -+ g_hash_table_remove (pending->thread_closure->outstanding, pending); -+ session_thread_process_pending_queue (pending->thread_closure); -+ pending_uri_unref (pending); -+} -+ -+static void - on_out_splice_complete (GObject *object, - GAsyncResult *result, - gpointer user_data) -@@ -770,7 +798,10 @@ on_out_splice_complete (GObject *object, - - out: - if (local_error) -- g_task_return_error (task, local_error); -+ { -+ g_task_return_error (task, local_error); -+ remove_pending_rerun_queue (pending); -+ } - - g_object_unref (task); - } -@@ -802,6 +833,7 @@ on_stream_read (GObject *object, - g_task_return_pointer (task, - g_strdup (pending->out_tmpfile), - (GDestroyNotify) g_free); -+ remove_pending_rerun_queue (pending); - } - else - { -@@ -837,7 +869,10 @@ on_stream_read (GObject *object, - - out: - if (local_error) -- g_task_return_error (task, local_error); -+ { -+ g_task_return_error (task, local_error); -+ remove_pending_rerun_queue (pending); -+ } - - g_object_unref (task); - } -@@ -883,6 +918,7 @@ on_request_sent (GObject *object, - g_strdup (pending->out_tmpfile), - (GDestroyNotify) g_free); - } -+ remove_pending_rerun_queue (pending); - goto out; - } - else if (!SOUP_STATUS_IS_SUCCESSFUL (msg->status_code)) -@@ -947,6 +983,7 @@ on_request_sent (GObject *object, - g_task_return_pointer (task, - g_object_ref (pending->request_body), - (GDestroyNotify) g_object_unref); -+ remove_pending_rerun_queue (pending); - } - - out: -@@ -955,6 +992,7 @@ on_request_sent (GObject *object, - if (pending->request_body) - (void) g_input_stream_close (pending->request_body, NULL, NULL); - g_task_return_error (task, local_error); -+ remove_pending_rerun_queue (pending); - } - - g_object_unref (task); -@@ -979,6 +1017,7 @@ ostree_fetcher_request_uri_internal (OstreeFetcher *self, - - /* SoupRequest is created in session thread. */ - pending = g_new0 (OstreeFetcherPendingURI, 1); -+ pending->ref_count = 1; - pending->thread_closure = thread_closure_ref (self->thread_closure); - pending->uri = soup_uri_copy (uri); - pending->max_size = max_size; -@@ -986,7 +1025,7 @@ ostree_fetcher_request_uri_internal (OstreeFetcher *self, - - task = g_task_new (self, cancellable, callback, user_data); - g_task_set_source_tag (task, source_tag); -- g_task_set_task_data (task, pending, (GDestroyNotify) pending_uri_free); -+ g_task_set_task_data (task, pending, (GDestroyNotify) pending_uri_unref); - - /* We'll use the GTask priority for our own priority queue. */ - g_task_set_priority (task, priority); --- -2.5.5 - diff --git a/SPECS/ostree.spec b/SPECS/ostree.spec index e28e414..fc358dd 100644 --- a/SPECS/ostree.spec +++ b/SPECS/ostree.spec @@ -1,14 +1,13 @@ Summary: Tool for managing bootable, immutable filesystem trees Name: ostree -Version: 2016.5 -Release: 3.atomic%{?dist} +Version: 2016.7 +Release: 2.atomic%{?dist} #VCS: git:https://github.com/ostreedev/ostree # The source tarball is generated via make -C packaging dist-snapshot # which handles git submodules. Source0: %{name}-%{version}.tar.xz Source1: 91-ostree.preset Patch0: 0001-ostree-remount-Explicitly-set-tmp-to-01777.patch -Patch1: 0001-pull-Ensure-we-always-process-queue-only-from-main-t.patch License: LGPLv2+ URL: http://live.gnome.org/OSTree @@ -30,7 +29,7 @@ BuildRequires: pkgconfig(fuse) BuildRequires: pkgconfig(e2p) BuildRequires: libcap-devel BuildRequires: gpgme-devel -BuildRequires: pkgconfig(systemd) +BuildRequires: pkgconfig(libsystemd) BuildRequires: /usr/bin/g-ir-scanner BuildRequires: dracut BuildRequires: bison @@ -66,6 +65,7 @@ GRUB2 integration for OSTree %package fuse Summary: FUSE utilities for ostree +Requires: fuse %description fuse %{summary} @@ -77,7 +77,6 @@ Summary: FUSE utilities for ostree env NOCONFIGURE=1 ./autogen.sh %configure --disable-silent-rules \ --enable-gtk-doc \ - --disable-static-deltas \ --with-selinux \ --enable-libsoup-client-certs \ --with-dracut @@ -129,6 +128,10 @@ rm -rf $RPM_BUILD_ROOT %{_libexecdir}/ostree/grub2* %changelog +* Fri Jul 08 2016 walters@redhat.com - 2016.7-2.atomic +- New upstream version +- Add ostree-fuse -> fuse requirement so people can unmount the result + * Tue Apr 19 2016 Colin Walters - 2016.5-2.atomic - New upstream version - Backport patch for detected race conditions in pull