summaryrefslogtreecommitdiff
path: root/src/journal
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-01-04 02:15:45 +0100
committerLennart Poettering <lennart@poettering.net>2012-01-04 02:15:45 +0100
commitb788cc23aa50682fe80c1b78cc5e42aaf7d76bc5 (patch)
treefcc814bc0fb6a5f64c6b9e0b3822bae225c06dfc /src/journal
parent4b067dc9d2b8836a2250315445686ae83993a9b7 (diff)
journal: add memory barrier before linking in newly created entries
Diffstat (limited to 'src/journal')
-rw-r--r--src/journal/journal-file.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index 45aab0e54a..15a752d507 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -138,6 +138,9 @@ static int journal_file_refresh_header(JournalFile *f) {
f->header->boot_id = boot_id;
f->header->state = STATE_ONLINE;
+
+ __sync_synchronize();
+
return 0;
}
@@ -898,6 +901,8 @@ static int journal_file_link_entry(JournalFile *f, Object *o, uint64_t offset) {
assert(offset > 0);
assert(o->object.type == OBJECT_ENTRY);
+ __sync_synchronize();
+
/* Link up the entry itself */
r = link_entry_into_array(f,
&f->header->entry_array_offset,