[systemd-devel] Failed to open system journal: Invalid argument

Lennart Poettering lennart at poettering.net
Tue May 21 14:48:58 UTC 2019

On Di, 21.05.19 17:37, Kay One (kayone007 at gmail.com) wrote:

> Thanks for the reply Lennart.
> 1) mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, 28, 0) = -1 EINVAL
> > (Invalid argument) is the culprit for this error???


> 2) If YES. Is this JFFS2 MTD file system bug or

It's a missing feature of the fs implementation, that the journal
relies on. Memory mapping a file is not a particularly exotic feature,
and yes, file systems really should implement that.

So my recommendation would be: work with the jffs2 folks to add this
to the kernel. They already have it for PROT_READ afaik, doing it for
PROT_WRITE is extra work, and not trivial but it will fix jffs2 for
every program that uses mmap for writing, and journald is just one of

> 3) Is this not considered as systemd bug to support compatibility for such
> file system? Check first FS support writable mappings or not and if not
> then use other method to enable Persistence logging for systemd?

I think it's better to fix jffs2 in this regard than to add a
userspace workaround to every single consumer of it.

Doing this without mmap() is not trivial, and I don't see anyone
stepping up to do the work. It wouldn't precisely make our codebase
easier to read either...


Lennart Poettering, Berlin

More information about the systemd-devel mailing list