Re: [PATCH RFC 0/5] mm: GUP dirty + ->release_folio() fixes

From: Christoph Hellwig

Date: Fri Nov 20 2026 - 12:39:20 EST


On Thu, Nov 19, 2026 at 08:10:43PM +0000, Pedro Falcato wrote:
> - there is no problem in usual IO submission, but issues start to pop
> up with GUP, where the code flow (roughly) becomes:
> [get_user_pages(), etc]
> ->page_mkwrite() called here, or before
> ->private correctly populated with whatever the filesystem
> expects.
> folio is marked as dirty, initially.
> *write finishes*
> folio_lock();
> folio_mark_dirty();
> ->dirty_folio()
> dirty_folio expects ->private to be populated by
> ->page_mkwrite(), ->write_begin().
> folio_unlock();

Writes through GUP are known broken in this an in other ways. The
fix is not to create band aids, but to phase out the remaining
writers through GUP. Which is really long overdue, and I'm starting
to get really pissed at the maintainers not fixing that after years
of knowing the bugs and having the infrastructure to fix it.