- Import a better fix from upstream for bsc#1001765 - Added: 0001-pid1-more-informative-error-message-for-ignored-noti.patch 0001-pid1-process-zero-length-notification-messages-again.patch - Updated (no code changes, only patch metadata) 0001-If-the-notification-message-length-is-0-ignore-the-m.patch 0001-pid1-don-t-return-any-error-in-manager_dispatch_noti.patch - Re add back "udev: don't require nsserv and fillup" Did this in the wrong project... it was a complicated day today ;) - Added 2 patches to fix bsc#1001765 0001-If-the-notification-message-length-is-0-ignore-the-m.patch 0001-pid1-don-t-return-any-error-in-manager_dispatch_noti.patch - Revert "udev: don't require nsserv and fillup" It's been judged too late for being part of SLE12 final release. Nevertheless it's part of Factory and will be reintroduced after the final release is out (ie through an update). - systemd-sysv-convert: make sure that /var/lib/systemd/sysv-convert/database is always initialized (bsc#982211) If "--save" command was used and the sysv init script wasn't enabled at all the database file wasn't created at all. This makes the subsequent call to "--apply" fail even though this should not considered as an error. - Added patches to fix journal with FSS protection enabled (bsc#1000435) 0001-journal-fix-HMAC-calculation-when-appending-a-data-o.patch 0001-journal-set-STATE_ARCHIVED-as-part-of-offlining-2740.patch OBS-URL: https://build.opensuse.org/request/show/431464 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=241
94 lines
3.9 KiB
Diff
94 lines
3.9 KiB
Diff
From 0d0bad044f8f19c472acb69d10861a66d3d267b6 Mon Sep 17 00:00:00 2001
|
|
From: Vito Caputo <vcaputo@gnugeneration.com>
|
|
Date: Tue, 26 Apr 2016 23:29:43 -0700
|
|
Subject: [PATCH 1/1] journal: set STATE_ARCHIVED as part of offlining (#2740)
|
|
|
|
The only code path which makes a journal durable is via
|
|
journal_file_set_offline().
|
|
|
|
When we perform a rotate the journal's header->state is being set to
|
|
STATE_ARCHIVED prior to journal_file_set_offline() being called.
|
|
|
|
In journal_file_set_offline(), we short-circuit the entire offline when
|
|
f->header->state != STATE_ONLINE.
|
|
|
|
This all results in none of the journal_file_set_offline() fsync() calls
|
|
being reached when rotate archives a journal, so archived journals are
|
|
never explicitly made durable.
|
|
|
|
What we do now is instead of setting the f->header->state to
|
|
STATE_ARCHIVED directly in journal_file_rotate() prior to
|
|
journal_file_close(), we set an archive flag in f->archive for the
|
|
journal_file_set_offline() machinery to honor by committing
|
|
STATE_ARCHIVED instead of STATE_OFFLINE when set.
|
|
|
|
Prior to this, rotated journals were never getting fsync() explicitly
|
|
performed on them, since journal_file_set_offline() short-circuited.
|
|
Obviously this is undesirable, and depends entirely on the underlying
|
|
filesystem as to how much durability was achieved when simply closing
|
|
the file.
|
|
|
|
Note that this problem existed prior to the recent asynchronous fsync
|
|
changes, but those changes do facilitate our performing this durable
|
|
offline on rotate without blocking, regardless of the underlying
|
|
filesystem sync-on-close semantics.
|
|
|
|
(cherry picked from commit 8eb851711fd166024297c425e9261200c36f489d)
|
|
|
|
[fbui: context adjustment: the asynchronous journal_file_set_offline()
|
|
thingie doesn't exist in v228]
|
|
|
|
[fbui: this also fixes the case when we wanted to append a tag (for
|
|
FSS verification) when closing the journal. Before this patch,
|
|
journal_file_append_tag() failed (silently) because re-opening
|
|
the journal to write the tag was not possible since it was
|
|
already in "archived" mode.]
|
|
---
|
|
src/journal/journal-file.c | 10 ++++++++--
|
|
src/journal/journal-file.h | 1 +
|
|
2 files changed, 9 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
|
|
index f9ff954..e7eecad 100644
|
|
--- a/src/journal/journal-file.c
|
|
+++ b/src/journal/journal-file.c
|
|
@@ -130,7 +130,7 @@ int journal_file_set_offline(JournalFile *f) {
|
|
if (mmap_cache_got_sigbus(f->mmap, f->fd))
|
|
return -EIO;
|
|
|
|
- f->header->state = STATE_OFFLINE;
|
|
+ f->header->state = f->archive ? STATE_ARCHIVED : STATE_OFFLINE;
|
|
|
|
if (mmap_cache_got_sigbus(f->mmap, f->fd))
|
|
return -EIO;
|
|
@@ -2813,7 +2813,13 @@ int journal_file_rotate(JournalFile **f, bool compress, bool seal) {
|
|
if (r < 0 && errno != ENOENT)
|
|
return -errno;
|
|
|
|
- old_file->header->state = STATE_ARCHIVED;
|
|
+ /* Set as archive so offlining commits w/state=STATE_ARCHIVED.
|
|
+ * Previously we would set old_file->header->state to STATE_ARCHIVED directly here,
|
|
+ * but journal_file_set_offline() short-circuits when state != STATE_ONLINE, which
|
|
+ * would result in the rotated journal never getting fsync() called before closing.
|
|
+ * Now we simply queue the archive state by setting an archive bit, leaving the state
|
|
+ * as STATE_ONLINE so proper offlining occurs. */
|
|
+ old_file->archive = true;
|
|
|
|
/* Currently, btrfs is not very good with out write patterns
|
|
* and fragments heavily. Let's defrag our journal files when
|
|
diff --git a/src/journal/journal-file.h b/src/journal/journal-file.h
|
|
index 898d12d..436e5ff 100644
|
|
--- a/src/journal/journal-file.h
|
|
+++ b/src/journal/journal-file.h
|
|
@@ -76,6 +76,7 @@ typedef struct JournalFile {
|
|
bool compress_lz4:1;
|
|
bool seal:1;
|
|
bool defrag_on_close:1;
|
|
+ bool archive:1;
|
|
|
|
bool tail_entry_monotonic_valid:1;
|
|
|
|
--
|
|
2.10.0
|
|
|