Re: [PATCH 1/7] mm: fix folio_expected_ref_count() when PG_private_2

From: Matthew Wilcox
Date: Sun Aug 31 2025 - 19:37:38 EST


On Sun, Aug 31, 2025 at 02:01:16AM -0700, Hugh Dickins wrote:
> 6.16's folio_expected_ref_count() is forgetting the PG_private_2 flag,
> which (like PG_private, but not in addition to PG_private) counts for
> 1 more reference: it needs to be using folio_has_private() in place of
> folio_test_private().

No, it doesn't. I know it used to, but no filesystem was actually doing
that. So I changed mm to match how filesystems actually worked.
I'm not sure if there's still documentation lying around that gets
this wrong or if you're remembering how things used to be documented,
but it's never how any filesystem has ever worked.

We're achingly close to getting rid of PG_private_2. I think it's just
ceph and nfs that still use it.