From fcaf217ab2444a2b8fb7485b657ea274b10f5836 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Wed, 7 Oct 2026 20:09:08 +0200 Subject: [PATCH] journal: reset the offline state if blocking signals fails journal_file_set_offline() sets OFFLINE_SYNCING before it starts the offline thread. If the first pthread_sigmask() fails, it returns without starting the thread and leaves the state at OFFLINE_SYNCING. The next journal_file_set_offline_thread_join() then calls pthread_join() on a thread that was never created. Set OFFLINE_JOINED, as the error path of pthread_create() does. (cherry picked from commit db2b225a30da26d0939f1f6d6c4b524bd2240900) --- src/shared/journal-file-util.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/shared/journal-file-util.c b/src/shared/journal-file-util.c index 9425d76c00..60360017a2 100644 --- a/src/shared/journal-file-util.c +++ b/src/shared/journal-file-util.c @@ -377,8 +377,10 @@ int journal_file_set_offline(JournalFile *f, bool wait) { assert_se(sigdelset(&ss, SIGBUS) >= 0); r = pthread_sigmask(SIG_BLOCK, &ss, &saved_ss); - if (r > 0) + if (r > 0) { + f->offline_state = OFFLINE_JOINED; return -r; + } r = pthread_create(&f->offline_thread, NULL, journal_file_set_offline_thread, f);