Re: [PATCH v3 2/2] mm: fail the fault on a malformed swap entry instead of retrying it

From: David Hildenbrand (Arm)

Date: Tue Aug 18 2026 - 14:22:11 EST


On 8/18/26 12:06, Breno Leitao 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>
> ---

Acked-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>

--
Cheers,

David