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

2019-05-22 Thread Lennart Poettering
On Mi, 22.05.19 01:03, Kay One (kayone...@gmail.com) wrote:

> Hi Lennart,
>
> Do you have any idea that UBIFS supports writable memory mappings or
> not?

No idea, sorry!

This suggests that UBIFS treats mmap like any other fs would, and thus
probably also supports mmap() just fine in writable mode and everything:

https://yaffs.net/lurker/message/20100616.081709.b6153097.en.html

Lennart

--
Lennart Poettering, Berlin
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

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

2019-05-21 Thread Kay One
Hi Lennart,

Do you have any idea that UBIFS supports writable memory mappings or not?

Regards,
Karnik Jain

On Wed, May 22, 2019 at 12:05 AM Kay One  wrote:

> Thank you so much for your time.
> Let me try changing JFFS2 to UBIFS as another available option to use for
> my SOC.
>
> I would keep you guys posted.
>
> Regards,
> Karnik Jain
>
> On Tue, May 21, 2019 at 8:18 PM Lennart Poettering 
> wrote:
>
>> On Di, 21.05.19 17:37, Kay One (kayone...@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???
>>
>> Yes.
>>
>> > 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
>> them.
>>
>> > 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
>>
>> --
>> Lennart Poettering, Berlin
>>
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

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

2019-05-21 Thread Kay One
Thank you so much for your time.
Let me try changing JFFS2 to UBIFS as another available option to use for
my SOC.

I would keep you guys posted.

Regards,
Karnik Jain

On Tue, May 21, 2019 at 8:18 PM Lennart Poettering 
wrote:

> On Di, 21.05.19 17:37, Kay One (kayone...@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???
>
> Yes.
>
> > 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
> them.
>
> > 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
>
> --
> Lennart Poettering, Berlin
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

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

2019-05-21 Thread Lennart Poettering
On Di, 21.05.19 17:37, Kay One (kayone...@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???

Yes.

> 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
them.

> 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

--
Lennart Poettering, Berlin
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

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

2019-05-21 Thread Kay One
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
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?

On Tue, May 21, 2019 at 5:05 PM Lennart Poettering 
wrote:

> On Di, 21.05.19 16:45, Kay One (kayone...@gmail.com) wrote:
>
> > Hi Lennart,
> >
> > Thanks for the reply.
> > JFFS2 is the file system being used in my case. Also, if I would delete
> > /var/log/journal directory then these errors are stopping.
> > Meaning while writing to persistence storage this error is persisting all
> > the time.
> >
> > cat /proc/cmdline
> > console=ttyS0,115200 root=/dev/mtdblock2 rw rootfstype=jffs2
> >
> > df -Tk
> > Filesystem   Type   1K-blocks  Used Available Use%
> Mounted
> > on
> > /dev/root*jffs2*  81792 61220 20572  75% /
> > devtmpfs devtmpfs  506040 4506036   0% /dev
> > tmpfstmpfs 514744 4514740   0%
> /dev/shm
> > tmpfstmpfs 514744 13268501476   3% /run
> > tmpfstmpfs 514744 0514744   0%
> > /sys/fs/cgroup
> > tmpfstmpfs 514744 0514744   0% /tmp
> > /dev/mtdblock1   *jffs2*  20416  6784 13632  33%
> > /home/root/apps
> > tmpfstmpfs 102948 0102948   0%
> > /run/user/0
> >
> > Suspicious cause for this error:
> > --
> >
> >
> > mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, 28, 0) = -1 EINVAL
> > (Invalid argument)
>
> The journal requires a storage file system that supports writable
> memory mapping. Your's (jffs2) apparently does not, it's too limited
> for that.
>
> Maybe you can work with the kernel maintainers of that file system to
> add proper support for writbale mmap()?
>
> Lennart
>
> --
> Lennart Poettering, Berlin
>
1)
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

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

2019-05-21 Thread Lennart Poettering
On Di, 21.05.19 16:45, Kay One (kayone...@gmail.com) wrote:

> Hi Lennart,
>
> Thanks for the reply.
> JFFS2 is the file system being used in my case. Also, if I would delete
> /var/log/journal directory then these errors are stopping.
> Meaning while writing to persistence storage this error is persisting all
> the time.
>
> cat /proc/cmdline
> console=ttyS0,115200 root=/dev/mtdblock2 rw rootfstype=jffs2
>
> df -Tk
> Filesystem   Type   1K-blocks  Used Available Use% Mounted
> on
> /dev/root*jffs2*  81792 61220 20572  75% /
> devtmpfs devtmpfs  506040 4506036   0% /dev
> tmpfstmpfs 514744 4514740   0% /dev/shm
> tmpfstmpfs 514744 13268501476   3% /run
> tmpfstmpfs 514744 0514744   0%
> /sys/fs/cgroup
> tmpfstmpfs 514744 0514744   0% /tmp
> /dev/mtdblock1   *jffs2*  20416  6784 13632  33%
> /home/root/apps
> tmpfstmpfs 102948 0102948   0%
> /run/user/0
>
> Suspicious cause for this error:
> --
>
>
> mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, 28, 0) = -1 EINVAL
> (Invalid argument)

The journal requires a storage file system that supports writable
memory mapping. Your's (jffs2) apparently does not, it's too limited
for that.

Maybe you can work with the kernel maintainers of that file system to
add proper support for writbale mmap()?

Lennart

--
Lennart Poettering, Berlin
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

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

2019-05-20 Thread Lennart Poettering
On Sa, 18.05.19 09:59, Kay One (kayone...@gmail.com) wrote:

> *[ 2002.668599] systemd-journald[743]: Journal effective settings seal=yes
> compress=yes compress_threshold_bytes=512B*
> *[ 2002.679080] systemd-journald[743]: Failed to open system journal:
> Invalid argument*

Hmm, this is interesting. I wonder how that happens. Does stracing the
journald show anything interesting? i.e. some syscall throwing EINVAL?

What's the file system used?

Lennart

--
Lennart Poettering, Berlin
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

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

2019-05-17 Thread Kay One
Hello Folks,
I have enabled more debug logs & realized following 2 logs are continuously
being dump.
*Is it some known bug for systemd-journald for following version? I am
using Angstrom distribution of debian OS?*

root@arria10:~# uname -a
Linux arria10 4.9.78-ltsi #1 SMP Thu Dec 13 12:01:27 PST 2018 armv7l
GNU/Linux

root@arria10:~# systemctl --version
systemd 239
+PAM -AUDIT -SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP -LIBCRYPTSETUP
+GCRYPT +GNUTLS +ACL +XZ +LZ4 -SECCOMP +BLKID -ELFUTILS +KMOD -IDN2 +IDN
-PCRE2 default-hierarchy=hybrid

LOG:
--
root@arria10:~#
*[ 2002.668599] systemd-journald[743]: Journal effective settings seal=yes
compress=yes compress_threshold_bytes=512B*
*[ 2002.679080] systemd-journald[743]: Failed to open system journal:
Invalid argument*
[ 2002.686750] systemd-journald[743]: Journal effective settings seal=yes
compress=yes compress_threshold_bytes=512B
[ 2002.697135] systemd-journald[743]: Failed to open system journal:
Invalid argument
[ 2002.705876] systemd-journald[743]: Journal effective settings seal=yes
compress=yes compress_threshold_bytes=512B
[ 2002.716317] systemd-journald[743]: Failed to open system journal:
Invalid argument
[ 2002.723999] systemd-journald[743]: Journal effective settings seal=yes
compress=yes compress_threshold_bytes=512B
[ 2002.734703] systemd-journald[743]: Failed to open system journal:
Invalid argument
[ 2002.742845] systemd-journald[743]: Journal effective settings seal=yes
compress=yes compress_threshold_bytes=512B
[ 2062.663137] systemd-journald[743]: Journal effective settings seal=yes
compress=yes compress_threshold_bytes=512B
[ 2062.673722] systemd-journald[743]: Failed to open system journal:
Invalid argument
[ 2062.681505] systemd-journald[743]: Journal effective settings seal=yes
compress=yes compress_threshold_bytes=512B
[ 2062.691980] systemd-journald[743]: Failed to open system journal:
Invalid argument
[ 2062.700808] systemd-journald[743]: Journal effective settings seal=yes
compress=yes compress_threshold_bytes=512B
[ 2062.711412] systemd-journald[743]: Failed to open system journal:
Invalid argument
[ 2062.719171] systemd-journald[743]: Journal effective settings seal=yes
compress=yes compress_threshold_bytes=512B
[ 2062.729639] systemd-journald[743]: Failed to open system journal:
Invalid argument
[ 2062.737827] systemd-journald[743]: Journal effective settings seal=yes
compress=yes compress_threshold_bytes=512B
[ 2062.748330] systemd-journald[743]: Failed to open system journal:
Invalid argument
[ 2112.662005] systemd-journald[743]: Sent WATCHDOG=1 notification.
[ 2112.669418] systemd-journald[743]: Journal effective settings seal=yes
compress=yes compress_threshold_bytes=512B
[ 2112.679851] systemd-journald[743]: Failed to open system journal:
Invalid argument
[ 2112.687503] systemd-journald[743]: Journal effective settings seal=yes
compress=yes compress_threshold_bytes=512B
[ 2112.697859] systemd-journald[743]: Failed to open system journal:
Invalid argument
[ 2112.706642] systemd-journald[743]: Journal effective settings seal=yes
compress=yes compress_threshold_bytes=512B
[ 2112.717098] systemd-journald[743]: Failed to open system journal:
Invalid argument
[ 2112.724776] systemd-journald[743]: Journal effective settings seal=yes
compress=yes compress_threshold_bytes=512B
[ 2112.735142] systemd-journald[743]: Failed to open system journal:
Invalid argument
[ 2112.743220] systemd-journald[743]: Journal effective settings seal=yes
compress=yes compress_threshold_bytes=512B
[ 2122.664190] systemd-journald[743]: Journal effective settings seal=yes
compress=yes compress_threshold_bytes=512B
[ 2122.674654] systemd-journald[743]: Failed to open system journal:
Invalid argument
[ 2122.682278] systemd-journald[743]: Journal effective settings seal=yes
compress=yes compress_threshold_bytes=512B
[ 2122.692638] systemd-journald[743]: Failed to open system journal:
Invalid argument
[ 2122.701584] systemd-journald[743]: Journal effective settings seal=yes
compress=yes compress_threshold_bytes=512B
[ 2122.712049] systemd-journald[743]: Failed to open system journal:
Invalid argument
[ 2122.719695] systemd-journald[743]: Journal effective settings seal=yes
compress=yes compress_threshold_bytes=512B
[ 2122.730205] systemd-journald[743]: Failed to open system journal:
Invalid argument
[ 2122.738354] systemd-journald[743]: Journal effective settings seal=yes
compress=yes compress_threshold_bytes=512B
[ 2122.748794] systemd-journald[743]: Failed to open system journal:
Invalid argument
[ 2128.913734] systemd-journald[743]: Journal effective settings seal=yes
compress=yes compress_threshold_bytes=512B
[ 2128.924461] systemd-journald[743]: Failed to open system journal:
Invalid argument
[ 2128.932107] systemd-journald[743]: Journal effective settings seal=yes
compress=yes compress_threshold_bytes=512B
[ 2128.942493] systemd-journald[743]: Failed to open system journal:
Invalid argument
[ 2128.951361] systemd-journald[743]: Journal effective