Re: [PATCH 3/3] mm: fail the fault on a malformed swap entry instead of retrying it
From: Breno Leitao
Date: Wed Aug 12 2026 - 07:00:15 EST
On Tue, Aug 11, 2026 at 05:38:50PM +0200, David Hildenbrand (Arm) wrote:
> On 8/10/26 18:26, Breno Leitao wrote:
> > --- a/mm/memory.c
> > +++ b/mm/memory.c
> > @@ -4957,6 +4957,9 @@ vm_fault_t do_swap_page(struct vm_fault *vmf)
> > /* Prevent swapoff from happening to us. */
> > si = get_swap_device(entry);
> > if (IS_ERR_OR_NULL(si)) {
> > + /* A malformed entry never becomes valid, so don't retry it. */
> > + if (IS_ERR(si))
> > + ret = VM_FAULT_SIGBUS;
> > si = NULL;
> > goto out;
>
> Better update the comment above get_swap_device() to include "bad swap entries"
> as well. Best do that as part of patch #2.
Ack, I will update and respin.
> I didn't look too closely, but conceptually LGTM
Thanks for the review so far!
--breno