1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-03 01:17:45 +03:00

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.

(cherry picked from commit cc137d53e3)
This commit is contained in:
David Tardon 2022-12-12 16:21:30 +01:00 committed by Zbigniew Jędrzejewski-Szmek
parent 892cb01c2b
commit a0ac79bce9

View File

@ -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;