Re: [PATCH 01/12] xfs: attr fork iext must be loaded before calling xfs_attr_is_leaf

Christoph Hellwig
2024-04-10T05:04:11Z

On Tue, Apr 09, 2024 at 05:50:38PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
>
> Christoph noticed that the xfs_attr_is_leaf in xfs_attr_get_ilocked can
> access the incore extent tree of the attr fork, but nothing in the
> xfs_attr_get path guarantees that the incore tree is actually loaded.
>
> Most of the time it is, but seeing as xfs_attr_is_leaf ignores the
> return value of xfs_iext_get_extent I guess we've been making choices
> based on random stack contents and nobody's complained?

Yes, I'm kinda puzzled.

Note that the dir code actually reads the extents in their
is_leaf/is_block helpers. But given how the attr code is structured
that would thread through a lot of code so it might not be worth it.

Reviewed-by: Christoph Hellwig <hch@lst.de>