Re: [PATCH v3 08/14] erofs: use folio_attach/detach_private() instead of direct assignment

From: David Hildenbrand (Arm)

Date: Tue Sep 08 2026 - 12:24:09 EST


On 9/8/26 04:56, Zi Yan wrote:
> erofs_onlinefolio_init/split/end() use folio->private without setting
> PG_private or increasing folio refcount and it works. But after PG_private
> is replaced by checking folio->private in a future commit, it can break
> folio_expected_ref_count(), since the folio has private data without
> elevated refcount. Change them to use folio_attach/detach_private().

Freezing the folio will properly work I assume, as we'd always freeze with that
refcount in mind or remove the reference (detach private) early?

I'm thinking of folio_ref_freeze() in __folio_freeze_and_split_unmapped().

Or is the ref only very short-lived either way such that we don't care?



--
Cheers,

David