Just some modernization/refactoring.
No change in behaviour, just let's do how we do things these days: use
flags param instead of list of bools.
/* In */
- r = journal_remote_server_init(&s, name, JOURNAL_WRITE_SPLIT_NONE, false, false);
+ r = journal_remote_server_init(&s, name, JOURNAL_WRITE_SPLIT_NONE, 0);
if (r < 0) {
assert_se(IN_SET(r, -ENOMEM, -EMFILE, -ENFILE));
return r;
finished = true;
for (;;) {
- r = process_source(source,
- journal_remote_server_global->compress,
- journal_remote_server_global->seal);
+ r = process_source(source, journal_remote_server_global->file_flags);
if (r == -EAGAIN)
break;
if (r < 0) {
int r, n, fd;
- r = journal_remote_server_init(s, arg_output, arg_split_mode, arg_compress, arg_seal);
+ r = journal_remote_server_init(
+ s,
+ arg_output,
+ arg_split_mode,
+ (arg_compress ? JOURNAL_COMPRESS : 0) |
+ (arg_seal ? JOURNAL_SEAL : 0));
if (r < 0)
return r;
return source;
}
-int process_source(RemoteSource *source, bool compress, bool seal) {
+int process_source(RemoteSource *source, JournalFileFlags file_flags) {
int r;
assert(source);
&source->importer.iovw,
&source->importer.ts,
&source->importer.boot_id,
- compress, seal);
+ file_flags);
if (r == -EBADMSG) {
log_warning_errno(r, "Entry is invalid, ignoring.");
r = 0;
RemoteSource* source_new(int fd, bool passive_fd, char *name, Writer *writer);
void source_free(RemoteSource *source);
-int process_source(RemoteSource *source, bool compress, bool seal);
+int process_source(RemoteSource *source, JournalFileFlags file_flags);
#include "alloc-util.h"
#include "journal-remote.h"
-static int do_rotate(ManagedJournalFile **f, MMapCache *m, bool compress, bool seal) {
- int r = managed_journal_file_rotate(f, m, compress, UINT64_MAX, seal, NULL);
+static int do_rotate(ManagedJournalFile **f, MMapCache *m, JournalFileFlags file_flags) {
+ int r;
+
+ r = managed_journal_file_rotate(f, m, file_flags, UINT64_MAX, NULL);
if (r < 0) {
if (*f)
log_error_errno(r, "Failed to rotate %s: %m", (*f)->file->path);
const struct iovec_wrapper *iovw,
const dual_timestamp *ts,
const sd_id128_t *boot_id,
- bool compress,
- bool seal) {
+ JournalFileFlags file_flags) {
int r;
assert(w);
if (journal_file_rotate_suggested(w->journal->file, 0, LOG_DEBUG)) {
log_info("%s: Journal header limits reached or header out-of-date, rotating",
w->journal->file->path);
- r = do_rotate(&w->journal, w->mmap, compress, seal);
+ r = do_rotate(&w->journal, w->mmap, file_flags);
if (r < 0)
return r;
}
return r;
log_debug_errno(r, "%s: Write failed, rotating: %m", w->journal->file->path);
- r = do_rotate(&w->journal, w->mmap, compress, seal);
+ r = do_rotate(&w->journal, w->mmap, file_flags);
if (r < 0)
return r;
else
const struct iovec_wrapper *iovw,
const dual_timestamp *ts,
const sd_id128_t *boot_id,
- bool compress,
- bool seal);
+ JournalFileFlags file_flags);
typedef enum JournalWriteSplitMode {
JOURNAL_WRITE_SPLIT_NONE,
assert_not_reached();
}
- r = managed_journal_file_open_reliably(filename,
- O_RDWR|O_CREAT, 0640,
- s->compress, UINT64_MAX, s->seal,
- &w->metrics,
- w->mmap, NULL,
- NULL, &w->journal);
+ r = managed_journal_file_open_reliably(
+ filename,
+ O_RDWR|O_CREAT,
+ s->file_flags,
+ 0640,
+ UINT64_MAX,
+ &w->metrics,
+ w->mmap,
+ NULL,
+ NULL,
+ &w->journal);
if (r < 0)
return log_error_errno(r, "Failed to open output journal %s: %m", filename);
RemoteServer *s,
const char *output,
JournalWriteSplitMode split_mode,
- bool compress,
- bool seal) {
+ JournalFileFlags file_flags) {
int r;
journal_remote_server_global = s;
s->split_mode = split_mode;
- s->compress = compress;
- s->seal = seal;
+ s->file_flags = file_flags;
if (output)
s->output = output;
source = s->sources[fd];
assert(source->importer.fd == fd);
- r = process_source(source, s->compress, s->seal);
+ r = process_source(source, s->file_flags);
if (journal_importer_eof(&source->importer)) {
size_t remaining;
const char *output; /* either the output file or directory */
JournalWriteSplitMode split_mode;
- bool compress;
- bool seal;
+ JournalFileFlags file_flags;
bool check_trust;
};
extern RemoteServer *journal_remote_server_global;
RemoteServer *s,
const char *output,
JournalWriteSplitMode split_mode,
- bool compress,
- bool seal);
+ JournalFileFlags file_flags);
int journal_remote_get_writer(RemoteServer *s, const char *host, Writer **writer);
Server *s,
bool reliably,
const char *fname,
- int flags,
+ int open_flags,
bool seal,
JournalMetrics *metrics,
ManagedJournalFile **ret) {
_cleanup_(managed_journal_file_closep) ManagedJournalFile *f = NULL;
+ JournalFileFlags file_flags;
int r;
assert(s);
assert(fname);
assert(ret);
+ file_flags = (s->compress.enabled ? JOURNAL_COMPRESS : 0) | (seal ? JOURNAL_SEAL : 0);
+
if (reliably)
- r = managed_journal_file_open_reliably(fname, flags, 0640, s->compress.enabled,
- s->compress.threshold_bytes, seal, metrics, s->mmap,
- s->deferred_closes, NULL, &f);
+ r = managed_journal_file_open_reliably(
+ fname,
+ open_flags,
+ file_flags,
+ 0640,
+ s->compress.threshold_bytes,
+ metrics,
+ s->mmap,
+ s->deferred_closes,
+ NULL,
+ &f);
else
- r = managed_journal_file_open(-1, fname, flags, 0640, s->compress.enabled,
- s->compress.threshold_bytes, seal, metrics, s->mmap,
- s->deferred_closes, NULL, &f);
+ r = managed_journal_file_open(
+ -1,
+ fname,
+ open_flags,
+ file_flags,
+ 0640,
+ s->compress.threshold_bytes,
+ metrics,
+ s->mmap,
+ s->deferred_closes,
+ NULL,
+ &f);
if (r < 0)
return r;
bool seal,
uint32_t uid) {
+ JournalFileFlags file_flags;
int r;
+
assert(s);
if (!*f)
return -EINVAL;
- r = managed_journal_file_rotate(f, s->mmap, s->compress.enabled, s->compress.threshold_bytes, seal, s->deferred_closes);
+ file_flags =
+ (s->compress.enabled ? JOURNAL_COMPRESS : 0)|
+ (seal ? JOURNAL_SEAL : 0);
+
+ r = managed_journal_file_rotate(f, s->mmap, file_flags, s->compress.threshold_bytes, s->deferred_closes);
if (r < 0) {
if (*f)
return log_error_errno(r, "Failed to rotate %s: %m", (*f)->file->path);
server_vacuum_deferred_closes(s);
/* Open the file briefly, so that we can archive it */
- r = managed_journal_file_open(fd,
- full,
- O_RDWR,
- 0640,
- s->compress.enabled,
- s->compress.threshold_bytes,
- s->seal,
- &s->system_storage.metrics,
- s->mmap,
- s->deferred_closes,
- NULL,
- &f);
+ r = managed_journal_file_open(
+ fd,
+ full,
+ O_RDWR,
+ (s->compress.enabled ? JOURNAL_COMPRESS : 0) |
+ (s->seal ? JOURNAL_SEAL : 0),
+ 0640,
+ s->compress.threshold_bytes,
+ &s->system_storage.metrics,
+ s->mmap,
+ s->deferred_closes,
+ NULL,
+ &f);
if (r < 0) {
log_warning_errno(r, "Failed to read journal file %s for rotation, trying to move it out of the way: %m", full);
int managed_journal_file_open(
int fd,
const char *fname,
- int flags,
+ int open_flags,
+ JournalFileFlags file_flags,
mode_t mode,
- bool compress,
uint64_t compress_threshold_bytes,
- bool seal,
JournalMetrics *metrics,
MMapCache *mmap_cache,
Set *deferred_closes,
if (!f)
return -ENOMEM;
- r = journal_file_open(fd, fname, flags, mode, compress, compress_threshold_bytes, seal, metrics,
+ r = journal_file_open(fd, fname, open_flags, file_flags, mode, compress_threshold_bytes, metrics,
mmap_cache, template ? template->file : NULL, &f->file);
if (r < 0)
return r;
int managed_journal_file_rotate(
ManagedJournalFile **f,
MMapCache *mmap_cache,
- bool compress,
+ JournalFileFlags file_flags,
uint64_t compress_threshold_bytes,
- bool seal,
Set *deferred_closes) {
_cleanup_free_ char *path = NULL;
r = managed_journal_file_open(
-1,
path,
- (*f)->file->flags,
+ (*f)->file->open_flags,
+ file_flags,
(*f)->file->mode,
- compress,
compress_threshold_bytes,
- seal,
NULL, /* metrics */
mmap_cache,
deferred_closes,
int managed_journal_file_open_reliably(
const char *fname,
- int flags,
+ int open_flags,
+ JournalFileFlags file_flags,
mode_t mode,
- bool compress,
uint64_t compress_threshold_bytes,
- bool seal,
JournalMetrics *metrics,
MMapCache *mmap_cache,
Set *deferred_closes,
int r;
- r = managed_journal_file_open(-1, fname, flags, mode, compress, compress_threshold_bytes, seal, metrics,
+ r = managed_journal_file_open(-1, fname, open_flags, file_flags, mode, compress_threshold_bytes, metrics,
mmap_cache, deferred_closes, template, ret);
if (!IN_SET(r,
-EBADMSG, /* Corrupted */
-ETXTBSY)) /* File is from the future */
return r;
- if ((flags & O_ACCMODE) == O_RDONLY)
+ if ((open_flags & O_ACCMODE) == O_RDONLY)
return r;
- if (!(flags & O_CREAT))
+ if (!(open_flags & O_CREAT))
return r;
if (!endswith(fname, ".journal"))
if (r < 0)
return r;
- return managed_journal_file_open(-1, fname, flags, mode, compress, compress_threshold_bytes, seal, metrics,
+ return managed_journal_file_open(-1, fname, open_flags, file_flags, mode, compress_threshold_bytes, metrics,
mmap_cache, deferred_closes, template, ret);
}
int managed_journal_file_open(
int fd,
const char *fname,
- int flags,
+ int open_flags,
+ JournalFileFlags file_flags,
mode_t mode,
- bool compress,
uint64_t compress_threshold_bytes,
- bool seal,
JournalMetrics *metrics,
MMapCache *mmap_cache,
Set *deferred_closes,
int managed_journal_file_open_reliably(
const char *fname,
- int flags,
+ int open_flags,
+ JournalFileFlags file_flags,
mode_t mode,
- bool compress,
uint64_t compress_threshold_bytes,
- bool seal,
JournalMetrics *metrics,
MMapCache *mmap_cache,
Set *deferred_closes,
ManagedJournalFile **ret);
ManagedJournalFile* managed_journal_file_initiate_close(ManagedJournalFile *f, Set *deferred_closes);
-int managed_journal_file_rotate(ManagedJournalFile **f, MMapCache *mmap_cache, bool compress, uint64_t compress_threshold_bytes, bool seal, Set *deferred_closes);
+int managed_journal_file_rotate(ManagedJournalFile **f, MMapCache *mmap_cache, JournalFileFlags file_flags, uint64_t compress_threshold_bytes, Set *deferred_closes);
fn = path_join(dn, "test.journal");
- r = managed_journal_file_open(-1, fn, O_CREAT|O_RDWR, 0644, false, 0, false, NULL, m, NULL, NULL, &new_journal);
+ r = managed_journal_file_open(-1, fn, O_CREAT|O_RDWR, 0, 0644, 0, NULL, m, NULL, NULL, &new_journal);
assert_se(r >= 0);
if (argc > 1)
m = mmap_cache_new();
assert_se(m != NULL);
- assert_ret(managed_journal_file_open(-1, name, O_RDWR|O_CREAT, 0644, true, UINT64_MAX, false, NULL, m, NULL, NULL, &f));
+ assert_ret(managed_journal_file_open(-1, name, O_RDWR|O_CREAT, JOURNAL_COMPRESS, 0644, UINT64_MAX, NULL, m, NULL, NULL, &f));
return f;
}
mkdtemp_chdir_chattr(t);
- assert_se(managed_journal_file_open(-1, "one.journal", O_RDWR|O_CREAT, 0644,
- true, UINT64_MAX, false, NULL, m, NULL, NULL, &one) == 0);
+ assert_se(managed_journal_file_open(-1, "one.journal", O_RDWR|O_CREAT, JOURNAL_COMPRESS, 0644,
+ UINT64_MAX, NULL, m, NULL, NULL, &one) == 0);
append_number(one, 1, &seqnum);
printf("seqnum=%"PRIu64"\n", seqnum);
memcpy(&seqnum_id, &one->file->header->seqnum_id, sizeof(sd_id128_t));
- assert_se(managed_journal_file_open(-1, "two.journal", O_RDWR|O_CREAT, 0644,
- true, UINT64_MAX, false, NULL, m, NULL, one, &two) == 0);
+ assert_se(managed_journal_file_open(-1, "two.journal", O_RDWR|O_CREAT, JOURNAL_COMPRESS, 0644,
+ UINT64_MAX, NULL, m, NULL, one, &two) == 0);
assert_se(two->file->header->state == STATE_ONLINE);
assert_se(!sd_id128_equal(two->file->header->file_id, one->file->header->file_id));
/* restart server */
seqnum = 0;
- assert_se(managed_journal_file_open(-1, "two.journal", O_RDWR, 0,
- true, UINT64_MAX, false, NULL, m, NULL, NULL, &two) == 0);
+ assert_se(managed_journal_file_open(-1, "two.journal", O_RDWR, JOURNAL_COMPRESS, 0,
+ UINT64_MAX, NULL, m, NULL, NULL, &two) == 0);
assert_se(sd_id128_equal(two->file->header->seqnum_id, seqnum_id));
assert_se(chdir(t) >= 0);
(void) chattr_path(t, FS_NOCOW_FL, FS_NOCOW_FL, NULL);
- assert_se(managed_journal_file_open(-1, "one.journal", O_RDWR|O_CREAT, 0666, true, UINT64_MAX, false, NULL, m, NULL, NULL, &one) == 0);
- assert_se(managed_journal_file_open(-1, "two.journal", O_RDWR|O_CREAT, 0666, true, UINT64_MAX, false, NULL, m, NULL, NULL, &two) == 0);
- assert_se(managed_journal_file_open(-1, "three.journal", O_RDWR|O_CREAT, 0666, true, UINT64_MAX, false, NULL, m, NULL, NULL, &three) == 0);
+ assert_se(managed_journal_file_open(-1, "one.journal", O_RDWR|O_CREAT, JOURNAL_COMPRESS, 0666, UINT64_MAX, NULL, m, NULL, NULL, &one) == 0);
+ assert_se(managed_journal_file_open(-1, "two.journal", O_RDWR|O_CREAT, JOURNAL_COMPRESS, 0666, UINT64_MAX, NULL, m, NULL, NULL, &two) == 0);
+ assert_se(managed_journal_file_open(-1, "three.journal", O_RDWR|O_CREAT, JOURNAL_COMPRESS, 0666, UINT64_MAX, NULL, m, NULL, NULL, &three) == 0);
for (i = 0; i < N_ENTRIES; i++) {
char *p, *q;
m = mmap_cache_new();
assert_se(m != NULL);
- r = journal_file_open(-1, fn, O_RDONLY, 0666, true, UINT64_MAX, !!verification_key, NULL, m, NULL, &f);
+ r = journal_file_open(-1, fn, O_RDONLY, JOURNAL_COMPRESS|(verification_key ? JOURNAL_SEAL : 0), 0666, UINT64_MAX, NULL, m, NULL, &f);
if (r < 0)
return r;
log_info("Generating...");
- assert_se(managed_journal_file_open(-1, "test.journal", O_RDWR|O_CREAT, 0666, true, UINT64_MAX, !!verification_key, NULL, m, NULL, NULL, &df) == 0);
+ assert_se(managed_journal_file_open(-1, "test.journal", O_RDWR|O_CREAT, JOURNAL_COMPRESS|(verification_key ? JOURNAL_SEAL : 0), 0666, UINT64_MAX, NULL, m, NULL, NULL, &df) == 0);
for (n = 0; n < N_ENTRIES; n++) {
struct iovec iovec;
log_info("Verifying...");
- assert_se(journal_file_open(-1, "test.journal", O_RDONLY, 0666, true, UINT64_MAX, !!verification_key, NULL, m, NULL, &f) == 0);
+ assert_se(journal_file_open(-1, "test.journal", O_RDONLY, JOURNAL_COMPRESS|(verification_key ? JOURNAL_SEAL: 0), 0666, UINT64_MAX, NULL, m, NULL, &f) == 0);
/* journal_file_print_header(f); */
journal_file_dump(f);
mkdtemp_chdir_chattr(t);
- assert_se(managed_journal_file_open(-1, "test.journal", O_RDWR|O_CREAT, 0666, true, UINT64_MAX, true, NULL, m, NULL, NULL, &f) == 0);
+ assert_se(managed_journal_file_open(-1, "test.journal", O_RDWR|O_CREAT, JOURNAL_COMPRESS|JOURNAL_SEAL, 0666, UINT64_MAX, NULL, m, NULL, NULL, &f) == 0);
assert_se(dual_timestamp_get(&ts));
assert_se(sd_id128_randomize(&fake_boot_id) == 0);
assert_se(journal_file_move_to_entry_by_seqnum(f->file, 10, DIRECTION_DOWN, &o, NULL) == 0);
- managed_journal_file_rotate(&f, m, true, UINT64_MAX, true, NULL);
- managed_journal_file_rotate(&f, m, true, UINT64_MAX, true, NULL);
+ managed_journal_file_rotate(&f, m, JOURNAL_SEAL|JOURNAL_COMPRESS, UINT64_MAX, NULL);
+ managed_journal_file_rotate(&f, m, JOURNAL_SEAL|JOURNAL_COMPRESS, UINT64_MAX, NULL);
(void) managed_journal_file_close(f);
mkdtemp_chdir_chattr(t);
- assert_se(managed_journal_file_open(-1, "test.journal", O_RDWR|O_CREAT, 0666, false, UINT64_MAX, false, NULL, m, NULL, NULL, &f1) == 0);
- assert_se(managed_journal_file_open(-1, "test-compress.journal", O_RDWR|O_CREAT, 0666, true, UINT64_MAX, false, NULL, m, NULL, NULL, &f2) == 0);
- assert_se(managed_journal_file_open(-1, "test-seal.journal", O_RDWR|O_CREAT, 0666, false, UINT64_MAX, true, NULL, m, NULL, NULL, &f3) == 0);
- assert_se(managed_journal_file_open(-1, "test-seal-compress.journal", O_RDWR|O_CREAT, 0666, true, UINT64_MAX, true, NULL, m, NULL, NULL, &f4) == 0);
+ assert_se(managed_journal_file_open(-1, "test.journal", O_RDWR|O_CREAT, 0, 0666, UINT64_MAX, NULL, m, NULL, NULL, &f1) == 0);
+ assert_se(managed_journal_file_open(-1, "test-compress.journal", O_RDWR|O_CREAT, JOURNAL_COMPRESS, 0666, UINT64_MAX, NULL, m, NULL, NULL, &f2) == 0);
+ assert_se(managed_journal_file_open(-1, "test-seal.journal", O_RDWR|O_CREAT, JOURNAL_SEAL, 0666, UINT64_MAX, NULL, m, NULL, NULL, &f3) == 0);
+ assert_se(managed_journal_file_open(-1, "test-seal-compress.journal", O_RDWR|O_CREAT, JOURNAL_COMPRESS|JOURNAL_SEAL, 0666, UINT64_MAX, NULL, m, NULL, NULL, &f4) == 0);
journal_file_print_header(f1->file);
puts("");
mkdtemp_chdir_chattr(t);
- assert_se(managed_journal_file_open(-1, "test.journal", O_RDWR|O_CREAT, 0666, true, compress_threshold, true, NULL, m, NULL, NULL, &f) == 0);
+ assert_se(managed_journal_file_open(-1, "test.journal", O_RDWR|O_CREAT, JOURNAL_COMPRESS|JOURNAL_SEAL, 0666, compress_threshold, NULL, m, NULL, NULL, &f) == 0);
dual_timestamp_get(&ts);
int journal_file_open(
int fd,
const char *fname,
- int flags,
+ int open_flags,
+ JournalFileFlags file_flags,
mode_t mode,
- bool compress,
uint64_t compress_threshold_bytes,
- bool seal,
JournalMetrics *metrics,
MMapCache *mmap_cache,
JournalFile *template,
assert(fd >= 0 || fname);
assert(mmap_cache);
- if (!IN_SET((flags & O_ACCMODE), O_RDONLY, O_RDWR))
+ if (!IN_SET((open_flags & O_ACCMODE), O_RDONLY, O_RDWR))
return -EINVAL;
- if ((flags & O_ACCMODE) == O_RDONLY && FLAGS_SET(flags, O_CREAT))
+ if ((open_flags & O_ACCMODE) == O_RDONLY && FLAGS_SET(open_flags, O_CREAT))
return -EINVAL;
- if (fname && (flags & O_CREAT) && !endswith(fname, ".journal"))
+ if (fname && (open_flags & O_CREAT) && !endswith(fname, ".journal"))
return -EINVAL;
f = new(JournalFile, 1);
.fd = fd,
.mode = mode,
- .flags = flags,
- .writable = (flags & O_ACCMODE) != O_RDONLY,
+ .open_flags = open_flags,
+ .writable = (open_flags & O_ACCMODE) != O_RDONLY,
#if HAVE_ZSTD
- .compress_zstd = compress,
+ .compress_zstd = FLAGS_SET(file_flags, JOURNAL_COMPRESS),
#elif HAVE_LZ4
- .compress_lz4 = compress,
+ .compress_lz4 = FLAGS_SET(file_flags, JOURNAL_COMPRESS),
#elif HAVE_XZ
- .compress_xz = compress,
+ .compress_xz = FLAGS_SET(file_flags, JOURNAL_COMPRESS),
#endif
.compress_threshold_bytes = compress_threshold_bytes == UINT64_MAX ?
DEFAULT_COMPRESS_THRESHOLD :
MAX(MIN_COMPRESS_THRESHOLD, compress_threshold_bytes),
#if HAVE_GCRYPT
- .seal = seal,
+ .seal = FLAGS_SET(file_flags, JOURNAL_SEAL),
#endif
};
* or so, we likely fail quickly than block for long. For regular files O_NONBLOCK has no effect, hence
* it doesn't hurt in that case. */
- f->fd = openat_report_new(AT_FDCWD, f->path, f->flags|O_CLOEXEC|O_NONBLOCK, f->mode, &newly_created);
+ f->fd = openat_report_new(AT_FDCWD, f->path, f->open_flags|O_CLOEXEC|O_NONBLOCK, f->mode, &newly_created);
if (f->fd < 0) {
r = f->fd;
goto fail;
newly_created = f->last_stat.st_size == 0 && f->writable;
}
- f->cache_fd = mmap_cache_add_fd(mmap_cache, f->fd, prot_from_flags(flags));
+ f->cache_fd = mmap_cache_add_fd(mmap_cache, f->fd, prot_from_flags(open_flags));
if (!f->cache_fd) {
r = -ENOMEM;
goto fail;
mode_t mode;
- int flags;
+ int open_flags;
bool writable:1;
bool compress_xz:1;
bool compress_lz4:1;
#endif
} JournalFile;
+typedef enum JournalFileFlags {
+ JOURNAL_COMPRESS = 1 << 0,
+ JOURNAL_SEAL = 1 << 1,
+} JournalFileFlags;
+
int journal_file_open(
int fd,
const char *fname,
- int flags,
+ int open_flags,
+ JournalFileFlags file_flags,
mode_t mode,
- bool compress,
uint64_t compress_threshold_bytes,
- bool seal,
JournalMetrics *metrics,
MMapCache *mmap_cache,
JournalFile *template,
goto finish;
}
- r = journal_file_open(fd, path, O_RDONLY, 0, false, 0, false, NULL, j->mmap, NULL, &f);
+ r = journal_file_open(fd, path, O_RDONLY, 0, 0, 0, NULL, j->mmap, NULL, &f);
if (r < 0) {
log_debug_errno(r, "Failed to open journal file %s: %m", path);
goto finish;