From: David Tardon Date: Mon, 12 Dec 2022 15:21:30 +0000 (+0100) Subject: swap: tell swapon to reinitialize swap if needed X-Git-Tag: v253-rc1~291 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cc137d53e36da5e57b060be5e621864f572b2cac;p=thirdparty%2Fsystemd.git swap: tell swapon to reinitialize swap if needed If the page size of a swap space doesn't match the page size of the currently running kernel, swapon will fail. Let's instruct it to reinitialize the swap space instead. --- diff --git a/src/core/swap.c b/src/core/swap.c index 2196793ad10..5c83c4780f5 100644 --- a/src/core/swap.c +++ b/src/core/swap.c @@ -827,7 +827,7 @@ static void swap_enter_activating(Swap *s) { } } - r = exec_command_set(s->control_command, "/sbin/swapon", NULL); + r = exec_command_set(s->control_command, "/sbin/swapon", "--fixpgsz", NULL); if (r < 0) goto fail;