Re: [PATCH v3 2/2] mm: fail the fault on a malformed swap entry instead of retrying it
From: Nhat Pham
Date: Tue Aug 18 2026 - 12:23:47 EST
On Tue, Aug 18, 2026 at 3:08 AM Breno Leitao <leitao@xxxxxxxxxx> wrote:
>
> do_swap_page() returns 0 when get_swap_device() fails, which the fault
> handler reads as "handled". For an entry that can never become valid
> the retry takes the same fault again, so the thread spins forever,
> retrying on the same fault.
>
> Return VM_FAULT_SIGBUS (Bad access) for a malformed entry (pr_err() was
> called at get_swap_device()).
>
> Acked-by: Kairui Song <kasong@xxxxxxxxxxx>
> Reviewed-by: Barry Song <baohua@xxxxxxxxxx>
> Signed-off-by: Breno Leitao <leitao@xxxxxxxxxx>
Reviewed-by: Nhat Pham <nphamcs@xxxxxxxxx>