xfs: attr fork iext must be loaded before calling xfs_attr_is_leaf
authorDarrick J. Wong <djwong@kernel.org>
Mon, 22 Apr 2024 16:47:24 +0000 (09:47 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 23 Apr 2024 14:46:51 +0000 (07:46 -0700)
commitef80de940a6344da1d4f12c948a0ad4d6ff6e841
tree2a3e312beb82d973e2ff78e743710724806b01f6
parentcda60317ac57add7a0a2865aa29afbc6caad3e9a
xfs: attr fork iext must be loaded before calling xfs_attr_is_leaf

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?

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/libxfs/xfs_attr.c
fs/xfs/xfs_attr_item.c
fs/xfs/xfs_attr_list.c