|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
From fe357da5e638f97081099a28b477d59cc6991189 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
From: Lennart Poettering <lennart@poettering.net>
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
Date: Thu, 6 Nov 2014 15:20:29 +0100
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
Subject: [PATCH] systemctl: when invokes as "reboot -f", sync()
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
We do this in the clean shutdown path in shutdown.c, hence we should do
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
is for "reboot -f", too.
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
(cherry picked from commit 4a3ad39957399c4a30fc472a804e72907ecaa4f9)
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
src/systemctl/systemctl.c | 9 +++++++--
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
1 file changed, 7 insertions(+), 2 deletions(-)
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
index 8481a9b20c..207a5e78dc 100644
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
--- a/src/systemctl/systemctl.c
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
+++ b/src/systemctl/systemctl.c
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
@@ -6948,8 +6948,13 @@ done:
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
static int halt_now(enum action a) {
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
-/* Make sure C-A-D is handled by the kernel from this
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
- * point on... */
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
+ /* The kernel will automaticall flush ATA disks and suchlike
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
+ * on reboot(), but the file systems need to be synce'd
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
+ * explicitly in advance. */
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
+ sync();
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
+ /* Make sure C-A-D is handled by the kernel from this point
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
+ * on... */
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
reboot(RB_ENABLE_CAD);
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
switch (a) {
|