Re: [PATCH v7 1/9] coredump: massage format_corname()
From: Jann Horn <jannh@google.com>
Date: 2025-05-15 20:53:26
Also in:
linux-fsdevel, linux-security-module, lkml
From: Jann Horn <jannh@google.com>
Date: 2025-05-15 20:53:26
Also in:
linux-fsdevel, linux-security-module, lkml
On Thu, May 15, 2025 at 12:04 AM Christian Brauner [off-list ref] wrote:
We're going to extend the coredump code in follow-up patches. Clean it up so we can do this more easily.
typo nit: format_corename() written wrong in patch title
Signed-off-by: Christian Brauner <brauner@kernel.org>
Reviewed-by: Jann Horn <jannh@google.com>
@@ -384,12 +393,12 @@ static int format_corename(struct core_name *cn, struct coredump_params *cprm, * If core_pattern does not include a %p (as is the default) * and core_uses_pid is set, then .%pid will be appended to * the filename. Do not do this for piped commands. */ - if (!ispipe && !pid_in_pattern && core_uses_pid) { + if (!(cn->core_type == COREDUMP_PIPE) && !pid_in_pattern && core_uses_pid) {
non-actionable note: "!(cn->core_type == COREDUMP_PIPE)" can be simplified to "cn->core_type != COREDUMP_PIPE"; but patch 4 rewrites this anyway, so no need to change this