Skip to content

Commit

Permalink
swap: tell swapon to reinitialize swap if needed
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dtardon authored and keszybz committed Dec 14, 2022
1 parent e146136 commit cc137d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/swap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit cc137d5

Please sign in to comment.