[PATCH] netfs: Fix netfs_page_mkwrite() to check folio->mapping is valid
David Howells
dhowells at redhat.com
Mon Jun 24 15:40:49 PDT 2024
Matthew Wilcox <willy at infradead.org> wrote:
> > if (folio_lock_killable(folio) < 0)
> > goto out;
> > + if (folio->mapping != mapping) {
> > + ret = VM_FAULT_NOPAGE | VM_FAULT_LOCKED;
> > + goto out;
> > + }
>
> Have you tested this?
I've tried to. generic/247 can trigger it, but the race happens rarely.
> I'd expect it to throw some VM assertions.
I didn't see any.
I guess VM_FAULT_LOCKED is not universally handled by the caller and that I
should unlock the folio myself instead.
David
More information about the linux-afs
mailing list