projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
076ea6f
)
journal-file: when rotating a journal file, fsync directory too
author
Lennart Poettering
<lennart@poettering.net>
Fri, 29 Apr 2016 10:21:52 +0000
(12:21 +0200)
committer
Lennart Poettering
<lennart@poettering.net>
Fri, 29 Apr 2016 10:24:09 +0000
(12:24 +0200)
As suggested by:
https://github.com/systemd/systemd/pull/3126#discussion_r61125474
src/journal/journal-file.c
patch
|
blob
|
history
diff --git
a/src/journal/journal-file.c
b/src/journal/journal-file.c
index
a58079b
..
c9ce5c7
100644
(file)
--- a/
src/journal/journal-file.c
+++ b/
src/journal/journal-file.c
@@
-3213,6
+3213,9
@@
int journal_file_rotate(JournalFile **f, bool compress, bool seal, Set *deferred
if (r < 0 && errno != ENOENT)
return -errno;
+ /* Sync the rename to disk */
+ (void) fsync_directory_of_file(old_file->fd);
+
/* 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