systemd/0652-core-mount-trivial-coding-style-cleanups.patch
Jan Macku b7ebf97389 systemd-257-24
Resolves: RHEL-155454, RHEL-155805, RHEL-155396, RHEL-158303, RHEL-158354, RHEL-143728, RHEL-168098, RHEL-143028
2026-04-16 15:01:05 +02:00

68 lines
2.3 KiB
Diff

From 3aa54774b2d343c63feb3f7eafa5b489e526a8dc Mon Sep 17 00:00:00 2001
From: Mike Yuan <me@yhndnzj.com>
Date: Wed, 12 Feb 2025 14:56:34 +0100
Subject: [PATCH] core/mount: trivial coding style cleanups
(cherry picked from commit c7c6cf2031c1c0eb1839d2ea83b5a8de4af6da00)
Related: RHEL-143028
---
src/core/mount.c | 7 +++----
src/core/mount.h | 2 +-
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/src/core/mount.c b/src/core/mount.c
index 6b38ee9431..8ec18d8952 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -45,9 +45,9 @@ static const UnitActiveState state_translation_table[_MOUNT_STATE_MAX] = {
[MOUNT_MOUNTING_DONE] = UNIT_ACTIVATING,
[MOUNT_MOUNTED] = UNIT_ACTIVE,
[MOUNT_REMOUNTING] = UNIT_RELOADING,
- [MOUNT_UNMOUNTING] = UNIT_DEACTIVATING,
[MOUNT_REMOUNTING_SIGTERM] = UNIT_RELOADING,
[MOUNT_REMOUNTING_SIGKILL] = UNIT_RELOADING,
+ [MOUNT_UNMOUNTING] = UNIT_DEACTIVATING,
[MOUNT_UNMOUNTING_SIGTERM] = UNIT_DEACTIVATING,
[MOUNT_UNMOUNTING_SIGKILL] = UNIT_DEACTIVATING,
[MOUNT_FAILED] = UNIT_FAILED,
@@ -1038,6 +1038,8 @@ static void mount_enter_unmounting(Mount *m) {
MOUNT_UNMOUNTING_SIGKILL))
m->n_retry_umount = 0;
+ mount_unwatch_control_pid(m);
+
m->control_command_id = MOUNT_EXEC_UNMOUNT;
m->control_command = m->exec_command + MOUNT_EXEC_UNMOUNT;
@@ -1047,8 +1049,6 @@ static void mount_enter_unmounting(Mount *m) {
goto fail;
}
- mount_unwatch_control_pid(m);
-
r = mount_spawn(m, m->control_command, &m->control_pid);
if (r < 0) {
log_unit_warning_errno(UNIT(m), r, "Failed to spawn 'umount' task: %m");
@@ -1056,7 +1056,6 @@ static void mount_enter_unmounting(Mount *m) {
}
mount_set_state(m, MOUNT_UNMOUNTING);
-
return;
fail:
diff --git a/src/core/mount.h b/src/core/mount.h
index 28cc7785d8..a8ae25e638 100644
--- a/src/core/mount.h
+++ b/src/core/mount.h
@@ -81,7 +81,7 @@ struct Mount {
MountState state, deserialized_state;
- ExecCommand* control_command;
+ ExecCommand *control_command;
MountExecCommand control_command_id;
PidRef control_pid;