From: dongshengyuan <545258830@qq.com> Date: Tue, 16 Jun 2026 02:38:17 +0000 (+0800) Subject: mount: log control command before clearing it in mount_sigchld_event() X-Git-Tag: v261-rc4~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cfed283b9ca36c36b3df9e8ee5f46070abe2893c;p=thirdparty%2Fsystemd.git mount: log control command before clearing it in mount_sigchld_event() control_command and control_command_id were cleared before being passed to unit_log_process_exit(), so the log always showed an invalid/unknown command name. Move both clears after the log call, matching the ordering in socket_sigchld_event() and service_sigchld_event(). Signed-off-by: dongshengyuan Co-developed-by: Claude Opus 4.8 (1M context) --- diff --git a/src/core/mount.c b/src/core/mount.c index 94aeea9f6c9..cf2d839347b 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -1554,13 +1554,9 @@ static void mount_sigchld_event(Unit *u, pid_t pid, int code, int status) { /* MOUNT_MOUNTING and MOUNT_UNMOUNTING states need to be patched, see below. */ m->result = f; - if (m->control_command) { + if (m->control_command) exec_status_exit(&m->control_command->exec_status, &m->exec_context, pid, code, status); - m->control_command = NULL; - m->control_command_id = _MOUNT_EXEC_COMMAND_INVALID; - } - unit_log_process_exit( u, "Mount process", @@ -1568,6 +1564,9 @@ static void mount_sigchld_event(Unit *u, pid_t pid, int code, int status) { f == MOUNT_SUCCESS, code, status); + m->control_command = NULL; + m->control_command_id = _MOUNT_EXEC_COMMAND_INVALID; + /* Note that due to the io event priority logic, we can be sure the new mountinfo is loaded * before we process the SIGCHLD for the mount command. */