Re: [PATCH] xfs: revalidate cached COW fork mappings during writeback
From: Anthony Vardaro (Anthropic)
Date: Fri Aug 21 2026 - 16:49:56 EST
On Thu, Aug 20, 2026 at 09:11:23AM -0700, Darrick J. Wong wrote:
> The buffered write path has similar data/cow fork sequence counter
> revalidation code, so would it be a better idea to adapt the writeback
> path to sample the sequence counter via xfs_iomap_inode_sequence in
> xfs_map_blocks, and re-check that in xfs_imap_valid()?
>
> I weakly hinted at this a few years ago when we were adapting the
> buffered write path, see [1].
>
> [1] https://lore.kernel.org/linux-xfs/Y2mcOCpKiDb4nf1X@magnolia/
I think that's reasonable. It's mostly deletion since
xfs_bmapi_convert_one_delalloc() already fills
wpc->iomap.validity_cookie. I'd still like 1/2 to stay the small
private cow_seq check so it can go to older stable trees, which don't
have validity_cookie or xfs_iomap_inode_sequence().
So for v2 I'll send two patches: 1/2 for this fix, Cc stable; 2/2
samples xfs_iomap_inode_sequence() in xfs_map_blocks(), compares the
cookie in xfs_imap_valid(), and removes data_seq/cow_seq, with the cost
measured again.
Anthony