Re: [PATCH] mm/shmem: fix uninitialized folio in shmem_symlink

From: Baolin Wang

Date: Tue Jan 06 2026 - 20:21:38 EST




On 1/7/26 2:46 AM, Matthew Wilcox wrote:
On Tue, Jan 06, 2026 at 11:47:44AM +0800, Baolin Wang wrote:
Why I prefer Barry's fix: First, the symlink folio is marked Uptodate after
copying the symlink name, but the whole folio hasn’t been initialized, which
seems unreasonable to me. Second, as I said before, using the 'PG_owner_2'
flag to mark this uncommon case doesn’t seem worthwhile. Currently, IIUC the
'PG_owner_2' is only used by btrfs; if we ever want to remove the
'PG_owner_2', this uncommon symlink case shouldn’t block its removal.

PG_owner_2 is aliased with PG_mappedtodisk [1], so it's used by every
filesystem which uses buffer_heads (whether mentioned in that filesystem
or not). btrfs was switched from using private_2 to using owner_2
a little over a year ago. PG_owner_2 is not on the list of flags to be
removed; that's PG_private, PG_private_2 and PG_reserved.

OK. Thanks for the explanation. I understand the plan.