]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
xfs: remove xfs_attr_leaf_hasname
authorChristoph Hellwig <hch@lst.de>
Fri, 9 Jan 2026 15:17:40 +0000 (16:17 +0100)
committerSasha Levin <sashal@kernel.org>
Wed, 4 Mar 2026 12:21:11 +0000 (07:21 -0500)
commit457121c01f609b9934addbb04d5c1ef638c71c61
tree1a3ba0b2c5f7f18804f38fd6f8657df2f978ee62
parent00195330d172e95e338898d8b23670c76f0c0c0a
xfs: remove xfs_attr_leaf_hasname

[ Upstream commit 3a65ea768b8094e4699e72f9ab420eb9e0f3f568 ]

The calling convention of xfs_attr_leaf_hasname() is problematic, because
it returns a NULL buffer when xfs_attr3_leaf_read fails, a valid buffer
when xfs_attr3_leaf_lookup_int returns -ENOATTR or -EEXIST, and a
non-NULL buffer pointer for an already released buffer when
xfs_attr3_leaf_lookup_int fails with other error values.

Fix this by simply open coding xfs_attr_leaf_hasname in the callers, so
that the buffer release code is done by each caller of
xfs_attr3_leaf_read.

Cc: stable@vger.kernel.org # v5.19+
Fixes: 07120f1abdff ("xfs: Add xfs_has_attr and subroutines")
Reported-by: Mark Tinguely <mark.tinguely@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/xfs/libxfs/xfs_attr.c