<div dir="ltr">Folks,<div><br></div><div style>Any chance to get this up-streamed?</div><div class="gmail_extra"><br clear="all"><div><div dir="ltr"><div>Regards,</div><div><br></div>--<br>*dS<br>Diego Sueiro<br><br>Administrador do Embarcados<br>
<a href="http://www.embarcados.com.br" target="_blank">www.embarcados.com.br</a><br><br>/*long live rock 'n roll*/<br></div></div>
<br><br><div class="gmail_quote">On Sat, Feb 1, 2014 at 7:07 AM, Diego Sueiro <span dir="ltr"><<a href="mailto:diego.sueiro@gmail.com" target="_blank">diego.sueiro@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The upstream bug report can be seen at:<br>
[Systemd #68161] -- <a href="https://bugs.freedesktop.org/show_bug.cgi?id=68161" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=68161</a><br>
<br>
This backports patches come from 207 and need to address this in the 206 version for dora branch.<br>
<br>
Signed-off-by: Diego Sueiro <<a href="mailto:diego.sueiro@gmail.com">diego.sueiro@gmail.com</a>><br>
---<br>
...ournald-fix-fd-leak-in-journal_file_empty.patch | 27 ++++++++++++++<br>
...urnald-fix-vacuuming-of-archived-journals.patch | 37 ++++++++++++++++++++<br>
meta/recipes-core/systemd/<a href="http://systemd_206.bb" target="_blank">systemd_206.bb</a> | 2 ++<br>
3 files changed, 66 insertions(+)<br>
create mode 100644 meta/recipes-core/systemd/systemd/journald-fix-fd-leak-in-journal_file_empty.patch<br>
create mode 100644 meta/recipes-core/systemd/systemd/journald-fix-vacuuming-of-archived-journals.patch<br>
<br>
diff --git a/meta/recipes-core/systemd/systemd/journald-fix-fd-leak-in-journal_file_empty.patch b/meta/recipes-core/systemd/systemd/journald-fix-fd-leak-in-journal_file_empty.patch<br>
new file mode 100644<br>
index 0000000..a83c858<br>
--- /dev/null<br>
+++ b/meta/recipes-core/systemd/systemd/journald-fix-fd-leak-in-journal_file_empty.patch<br>
@@ -0,0 +1,27 @@<br>
+journald: fix fd leak in journal_file_empty<br>
+Before my previous patch, journal_file_empty wasn't be called with the<br>
+correct filename. Now that it's being called with the correct filename<br>
+it leaks file descriptors. This patch closes the file descriptors before<br>
+returning.<br>
+<br>
+Signed-off-by: George McCollister <<a href="mailto:george.mccollister@gmail.com">george.mccollister@gmail.com</a>><br>
+<br>
+<br>
+Index: systemd-206/src/journal/journal-vacuum.c<br>
+===================================================================<br>
+--- systemd-206.orig/src/journal/journal-vacuum.c 2013-07-21 19:43:28.146183128 -0300<br>
++++ systemd-206/src/journal/journal-vacuum.c 2014-01-29 20:43:27.492343295 -0200<br>
+@@ -129,9 +129,9 @@<br>
+ }<br>
+<br>
+ static int journal_file_empty(int dir_fd, const char *name) {<br>
+- int fd, r;<br>
++ int r;<br>
+ le64_t n_entries;<br>
+-<br>
++ _cleanup_close_ int fd;<br>
+ fd = openat(dir_fd, name, O_RDONLY|O_CLOEXEC|O_NOFOLLOW|O_NONBLOCK);<br>
+ if (fd < 0)<br>
+ return -errno;<br>
+<br>
+Upstream-Status: Backport [207]<br>
diff --git a/meta/recipes-core/systemd/systemd/journald-fix-vacuuming-of-archived-journals.patch b/meta/recipes-core/systemd/systemd/journald-fix-vacuuming-of-archived-journals.patch<br>
new file mode 100644<br>
index 0000000..7c59200<br>
--- /dev/null<br>
+++ b/meta/recipes-core/systemd/systemd/journald-fix-vacuuming-of-archived-journals.patch<br>
@@ -0,0 +1,37 @@<br>
+journald: fix vacuuming of archived journals<br>
+d_name is modified on line 227 so if the entire journal name is needed<br>
+again p must be used. Before this change when journal_file_empty was called<br>
+on archived journals it would always return with -2.<br>
+<br>
+Signed-off-by: George McCollister <<a href="mailto:george.mccollister@gmail.com">george.mccollister@gmail.com</a>><br>
+<br>
+Index: systemd-206/src/journal/journal-vacuum.c<br>
+===================================================================<br>
+--- systemd-206.orig/src/journal/journal-vacuum.c 2014-01-29 20:43:27.492343295 -0200<br>
++++ systemd-206/src/journal/journal-vacuum.c 2014-01-29 20:48:55.076356876 -0200<br>
+@@ -265,18 +265,18 @@<br>
+ /* We do not vacuum active files or unknown files! */<br>
+ continue;<br>
+<br>
+- if (journal_file_empty(dirfd(d), de->d_name)) {<br>
++ if (journal_file_empty(dirfd(d), p)) {<br>
+<br>
+ /* Always vacuum empty non-online files. */<br>
+<br>
+- if (unlinkat(dirfd(d), de->d_name, 0) >= 0)<br>
+- log_debug("Deleted empty journal %s/%s.", directory, de->d_name);<br>
++ if (unlinkat(dirfd(d), p, 0) >= 0)<br>
++ log_debug("Deleted empty journal %s/%s.", directory, p);<br>
+ else if (errno != ENOENT)<br>
+- log_warning("Failed to delete %s/%s: %m", directory, de->d_name);<br>
++ log_warning("Failed to delete %s/%s: %m", directory, p);<br>
+ continue;<br>
+ }<br>
+<br>
+- patch_realtime(directory, de->d_name, &st, &realtime);<br>
++ patch_realtime(directory, p, &st, &realtime);<br>
+<br>
+ GREEDY_REALLOC(list, n_allocated, n_list + 1);<br>
+<br>
+<br>
+Upstream-Status: Backport [207]<br>
diff --git a/meta/recipes-core/systemd/<a href="http://systemd_206.bb" target="_blank">systemd_206.bb</a> b/meta/recipes-core/systemd/<a href="http://systemd_206.bb" target="_blank">systemd_206.bb</a><br>
index a1a8bd7..e7d0f1f 100644<br>
--- a/meta/recipes-core/systemd/<a href="http://systemd_206.bb" target="_blank">systemd_206.bb</a><br>
+++ b/meta/recipes-core/systemd/<a href="http://systemd_206.bb" target="_blank">systemd_206.bb</a><br>
@@ -21,6 +21,8 @@ SRC_URI = "<a href="http://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz" target="_blank">http://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz</a> \<br>
file://0001-use-CAP_MKNOD-ConditionCapability.patch \<br>
file://0001-Use-bin-mkdir-instead-of-host-mkdir-path.patch \<br>
file://binfmt-install.patch \<br>
+ file://journald-fix-fd-leak-in-journal_file_empty.patch \<br>
+ file://journald-fix-vacuuming-of-archived-journals.patch \<br>
file://touchscreen.rules \<br>
${UCLIBCPATCHES} \<br>
file://00-create-volatile.conf \<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.10.4<br>
<br>
</font></span></blockquote></div><br></div></div>