Re: [PATCH v10 22/33] mm/filemap: Add __folio_lock_or_retry

From: Matthew Wilcox
Date: Tue May 18 2021 - 09:36:24 EST


On Tue, May 18, 2021 at 12:38:46PM +0200, Vlastimil Babka wrote:
> > -int __lock_page_or_retry(struct page *page, struct mm_struct *mm,
> > +int __folio_lock_or_retry(struct folio *folio, struct mm_struct *mm,
> > unsigned int flags)
> > {
> > - struct folio *folio = page_folio(page);
> > -
> > if (fault_flag_allow_retry_first(flags)) {
> > /*
> > * CAUTION! In this case, mmap_lock is not released
>
> A bit later in this branch, 'page' is accessed, but it no longer exists. And
> thus as expected, it doesn't compile. Assuming it's fixed later, but
> bisectability etc...

Oops. Thanks for catching that; I've reordered this patch and the
folio_wait_locked() patch, which makes the entire problem go away.