linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Claudio Imbrenda <imbrenda@linux.ibm.com>
To: David Hildenbrand <david@redhat.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	John Hubbard <jhubbard@nvidia.com>, Peter Xu <peterx@redhat.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>
Subject: Re: [PATCH v1] mm/gup: fix handling of errors from arch_make_folio_accessible() in follow_page_pte()
Date: Wed, 10 Sep 2025 10:57:15 +0200	[thread overview]
Message-ID: <20250910105715.7f4f8495@p-imbrenda> (raw)
In-Reply-To: <1228a0a7-660e-4993-887d-66bc2c37b8f4@redhat.com>

On Tue, 9 Sep 2025 18:15:17 +0200
David Hildenbrand <david@redhat.com> wrote:

> On 09.09.25 18:07, Claudio Imbrenda wrote:
> > On Mon,  8 Sep 2025 11:45:17 +0200
> > David Hildenbrand <david@redhat.com> wrote:
> >   
> >> In case we call arch_make_folio_accessible() and it fails, we would
> >> incorrectly return a value that is "!= 0" to the caller, indicating that
> >> we pinned all requested pages and that the caller can keep going.
> >>
> >> follow_page_pte() is not supposed to return error values, but instead
> >> "0" on failure and "1" on success -- we'll clean that up separately.
> >>
> >> In case we return "!= 0", the caller will just keep going pinning
> >> more pages. If we happen to pin a page afterwards, we're in trouble,
> >> because we essentially skipped some pages in the requested range.
> >>
> >> Staring at the arch_make_folio_accessible() implementation on s390x, I
> >> assume it should actually never really fail unless something unexpected
> >> happens (BUG?). So let's not CC stable and just fix common code to do
> >> the right thing.
> >>
> >> Clean up the code a bit now that there is no reason to store the
> >> return value of arch_make_folio_accessible().
> >>
> >> Fixes: f28d43636d6f ("mm/gup/writeback: add callbacks for inaccessible pages")  
> > 
> > Ooops!
> > 
> > thanks for finding and fixing this  
> 
> Thanks! Is my assumption correct that this is not stable material?
> 

your assessment looks correct, an error return value can only be caused
by a bug


      reply	other threads:[~2025-09-10  8:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-08  9:45 David Hildenbrand
2025-09-09 16:07 ` Claudio Imbrenda
2025-09-09 16:15   ` David Hildenbrand
2025-09-10  8:57     ` Claudio Imbrenda [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250910105715.7f4f8495@p-imbrenda \
    --to=imbrenda@linux.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=borntraeger@de.ibm.com \
    --cc=david@redhat.com \
    --cc=jgg@ziepe.ca \
    --cc=jhubbard@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=peterx@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox