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