naccyde / rpms / systemd

Forked from rpms/systemd a year ago
Clone
2aacef
From 94bab389194116ab10a68bca3d72c5b06f332645 Mon Sep 17 00:00:00 2001
2aacef
From: David Tardon <dtardon@redhat.com>
2aacef
Date: Mon, 12 Dec 2022 16:21:30 +0100
2aacef
Subject: [PATCH] swap: tell swapon to reinitialize swap if needed
2aacef
2aacef
If the page size of a swap space doesn't match the page size of the
2aacef
currently running kernel, swapon will fail. Let's instruct it to
2aacef
reinitialize the swap space instead.
2aacef
2aacef
(cherry picked from commit cc137d53e36da5e57b060be5e621864f572b2cac)
2aacef
2aacef
Resolves: #2151993
2aacef
---
2aacef
 src/core/swap.c | 2 +-
2aacef
 1 file changed, 1 insertion(+), 1 deletion(-)
2aacef
2aacef
diff --git a/src/core/swap.c b/src/core/swap.c
2aacef
index 2196793ad1..5c83c4780f 100644
2aacef
--- a/src/core/swap.c
2aacef
+++ b/src/core/swap.c
2aacef
@@ -827,7 +827,7 @@ static void swap_enter_activating(Swap *s) {
2aacef
                 }
2aacef
         }
2aacef
 
2aacef
-        r = exec_command_set(s->control_command, "/sbin/swapon", NULL);
2aacef
+        r = exec_command_set(s->control_command, "/sbin/swapon", "--fixpgsz", NULL);
2aacef
         if (r < 0)
2aacef
                 goto fail;
2aacef