* [PATCH] systemd: backport patch to fix sysctl warning on boot
@ 2019-07-10 12:13 Matthias Schiffer
2019-07-10 12:31 ` ✗ patchtest: failure for " Patchwork
0 siblings, 1 reply; 5+ messages in thread
From: Matthias Schiffer @ 2019-07-10 12:13 UTC (permalink / raw)
To: openembedded-core
Due to improved validation of sysctl settings in recent kernels (5.2+, but
also stable kernels like 4.19.53), systemd will log an error message like
systemd[1]: Failed to bump fs.file-max, ignoring: Invalid argument
during boot. Backport the bugfix from the systemd master.
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
---
...-max-sysctl-to-LONG_MAX-rather-than-.patch | 39 +++++++++++++++++++
meta/recipes-core/systemd/systemd_242.bb | 1 +
2 files changed, 40 insertions(+)
create mode 100644 meta/recipes-core/systemd/systemd/0001-core-set-fs.file-max-sysctl-to-LONG_MAX-rather-than-.patch
diff --git a/meta/recipes-core/systemd/systemd/0001-core-set-fs.file-max-sysctl-to-LONG_MAX-rather-than-.patch b/meta/recipes-core/systemd/systemd/0001-core-set-fs.file-max-sysctl-to-LONG_MAX-rather-than-.patch
new file mode 100644
index 0000000000..ff64f58c9c
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0001-core-set-fs.file-max-sysctl-to-LONG_MAX-rather-than-.patch
@@ -0,0 +1,39 @@
+From 6e2f78948403a4cce45b9e34311c9577c624f066 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart@poettering.net>
+Date: Mon, 17 Jun 2019 10:51:25 +0200
+Subject: [PATCH] core: set fs.file-max sysctl to LONG_MAX rather than
+ ULONG_MAX
+
+Since kernel 5.2 the kernel thankfully returns proper errors when we
+write a value out of range to the sysctl. Which however breaks writing
+ULONG_MAX to request the maximum value. Hence let's write the new
+maximum value instead, LONG_MAX.
+
+/cc @brauner
+
+Fixes: #12803
+
+Upstream-Status: Backport
+
+Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
+---
+ src/core/main.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/core/main.c b/src/core/main.c
+index b33ea1b5b5..e7f51815f0 100644
+--- a/src/core/main.c
++++ b/src/core/main.c
+@@ -1245,9 +1245,9 @@ static void bump_file_max_and_nr_open(void) {
+ #endif
+
+ #if BUMP_PROC_SYS_FS_FILE_MAX
+- /* I so wanted to use STRINGIFY(ULONG_MAX) here, but alas we can't as glibc/gcc define that as
+- * "(0x7fffffffffffffffL * 2UL + 1UL)". Seriously. 😢 */
+- if (asprintf(&t, "%lu\n", ULONG_MAX) < 0) {
++ /* The maximum the kernel allows for this since 5.2 is LONG_MAX, use that. (Previously thing where
++ * different but the operation would fail silently.) */
++ if (asprintf(&t, "%li\n", LONG_MAX) < 0) {
+ log_oom();
+ return;
+ }
diff --git a/meta/recipes-core/systemd/systemd_242.bb b/meta/recipes-core/systemd/systemd_242.bb
index 29f64b995a..ca083ad376 100644
--- a/meta/recipes-core/systemd/systemd_242.bb
+++ b/meta/recipes-core/systemd/systemd_242.bb
@@ -25,6 +25,7 @@ SRC_URI += "file://touchscreen.rules \
file://0006-network-remove-redunant-link-name-in-message.patch \
file://99-default.preset \
file://0001-resolved-Fix-incorrect-use-of-OpenSSL-BUF_MEM.patch \
+ file://0001-core-set-fs.file-max-sysctl-to-LONG_MAX-rather-than-.patch \
"
# patches needed by musl
--
2.17.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* ✗ patchtest: failure for systemd: backport patch to fix sysctl warning on boot
2019-07-10 12:13 [PATCH] systemd: backport patch to fix sysctl warning on boot Matthias Schiffer
@ 2019-07-10 12:31 ` Patchwork
2019-07-10 12:40 ` Matthias Schiffer
0 siblings, 1 reply; 5+ messages in thread
From: Patchwork @ 2019-07-10 12:31 UTC (permalink / raw)
To: matthias.schiffer; +Cc: openembedded-core
== Series Details ==
Series: systemd: backport patch to fix sysctl warning on boot
Revision: 1
URL : https://patchwork.openembedded.org/series/18605/
State : failure
== Summary ==
Thank you for submitting this patch series to OpenEmbedded Core. This is
an automated response. Several tests have been executed on the proposed
series by patchtest resulting in the following failures:
* Issue Series cannot be parsed correctly due to malformed diff lines [test_mbox_format]
Suggested fix Create the series again using git-format-patch and ensure it can be applied using git am
Diff line Hunk is shorter than expected
* Issue Series does not apply on top of target branch [test_series_merge_on_head]
Suggested fix Rebase your series on top of targeted branch
Targeted branch master (currently at 4cbb7392c7)
If you believe any of these test results are incorrect, please reply to the
mailing list (openembedded-core@lists.openembedded.org) raising your concerns.
Otherwise we would appreciate you correcting the issues and submitting a new
version of the patchset if applicable. Please ensure you add/increment the
version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
[PATCH v3] -> ...).
---
Guidelines: https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: ✗ patchtest: failure for systemd: backport patch to fix sysctl warning on boot
2019-07-10 12:31 ` ✗ patchtest: failure for " Patchwork
@ 2019-07-10 12:40 ` Matthias Schiffer
2019-07-15 9:53 ` Matthias Schiffer
0 siblings, 1 reply; 5+ messages in thread
From: Matthias Schiffer @ 2019-07-10 12:40 UTC (permalink / raw)
To: openembedded-core
On Wed, 2019-07-10 at 12:31 +0000, Patchwork wrote:
> == Series Details ==
>
> Series: systemd: backport patch to fix sysctl warning on boot
> Revision: 1
> URL : https://patchwork.openembedded.org/series/18605/
> State : failure
>
> == Summary ==
>
>
> Thank you for submitting this patch series to OpenEmbedded Core. This
> is
> an automated response. Several tests have been executed on the
> proposed
> series by patchtest resulting in the following failures:
>
>
>
> * Issue Series cannot be parsed correctly due to
> malformed diff lines [test_mbox_format]
> Suggested fix Create the series again using git-format-patch and
> ensure it can be applied using git am
> Diff line Hunk is shorter than expected
>
> * Issue Series does not apply on top of target branch
> [test_series_merge_on_head]
> Suggested fix Rebase your series on top of targeted branch
> Targeted branch master (currently at 4cbb7392c7)
I'm not sure what is going on here, the patch applies fine for me.
Is it possible that the patchtest stumbles over unicode characters in
the added patch file? I don't see how that could be avoided, as the
patch touches a line where an emoji was used in a comment...
Kind regards,
Matthias
>
>
>
> If you believe any of these test results are incorrect, please reply
> to the
> mailing list (openembedded-core@lists.openembedded.org) raising your
> concerns.
> Otherwise we would appreciate you correcting the issues and
> submitting a new
> version of the patchset if applicable. Please ensure you
> add/increment the
> version number when sending the new version (i.e. [PATCH] -> [PATCH
> v2] ->
> [PATCH v3] -> ...).
>
> ---
> Guidelines:
> https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
> Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
> Test suite:
> http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: ✗ patchtest: failure for systemd: backport patch to fix sysctl warning on boot
2019-07-10 12:40 ` Matthias Schiffer
@ 2019-07-15 9:53 ` Matthias Schiffer
2019-07-15 13:03 ` Richard Purdie
0 siblings, 1 reply; 5+ messages in thread
From: Matthias Schiffer @ 2019-07-15 9:53 UTC (permalink / raw)
To: openembedded-core
On Wed, 2019-07-10 at 14:40 +0200, Matthias Schiffer wrote:
> On Wed, 2019-07-10 at 12:31 +0000, Patchwork wrote:
> > * Issue Series cannot be parsed correctly due to
> > malformed diff lines [test_mbox_format]
> > Suggested fix Create the series again using git-format-patch
> > and
> > ensure it can be applied using git am
> > Diff line Hunk is shorter than expected
> >
> > * Issue Series does not apply on top of target branch
> > [test_series_merge_on_head]
> > Suggested fix Rebase your series on top of targeted branch
> > Targeted branch master (currently at 4cbb7392c7)
>
> I'm not sure what is going on here, the patch applies fine for me.
>
> Is it possible that the patchtest stumbles over unicode characters in
> the added patch file? I don't see how that could be avoided, as the
> patch touches a line where an emoji was used in a comment...
>
> Kind regards,
> Matthias
Ah, the issue is patchwork, not patchtest - the mbox download is cut
off at the non-ASCII character. Should I try resending the patch with
something like --transfer-encoding=quoted-printable ?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: ✗ patchtest: failure for systemd: backport patch to fix sysctl warning on boot
2019-07-15 9:53 ` Matthias Schiffer
@ 2019-07-15 13:03 ` Richard Purdie
0 siblings, 0 replies; 5+ messages in thread
From: Richard Purdie @ 2019-07-15 13:03 UTC (permalink / raw)
To: Matthias Schiffer, openembedded-core
On Mon, 2019-07-15 at 11:53 +0200, Matthias Schiffer wrote:
> On Wed, 2019-07-10 at 14:40 +0200, Matthias Schiffer wrote:
> > On Wed, 2019-07-10 at 12:31 +0000, Patchwork wrote:
> > > * Issue Series cannot be parsed correctly due to
> > > malformed diff lines [test_mbox_format]
> > > Suggested fix Create the series again using git-format-patch
> > > and
> > > ensure it can be applied using git am
> > > Diff line Hunk is shorter than expected
> > >
> > > * Issue Series does not apply on top of target branch
> > > [test_series_merge_on_head]
> > > Suggested fix Rebase your series on top of targeted branch
> > > Targeted branch master (currently at 4cbb7392c7)
> >
> > I'm not sure what is going on here, the patch applies fine for me.
> >
> > Is it possible that the patchtest stumbles over unicode characters
> > in
> > the added patch file? I don't see how that could be avoided, as the
> > patch touches a line where an emoji was used in a comment...
> >
> > Kind regards,
> > Matthias
>
> Ah, the issue is patchwork, not patchtest - the mbox download is cut
> off at the non-ASCII character. Should I try resending the patch with
> something like --transfer-encoding=quoted-printable ?
I've queued the patch for testing, the patch itself applies fine so we
can handle it, it just doesn't get the automated testing.
Cheers,
Richard
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-07-15 13:03 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-10 12:13 [PATCH] systemd: backport patch to fix sysctl warning on boot Matthias Schiffer
2019-07-10 12:31 ` ✗ patchtest: failure for " Patchwork
2019-07-10 12:40 ` Matthias Schiffer
2019-07-15 9:53 ` Matthias Schiffer
2019-07-15 13:03 ` Richard Purdie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox