]> www.infradead.org Git - users/willy/xarray.git/commit
xfs: distinguish extra split from real ENOSPC from xfs_attr3_leaf_split
authorChristoph Hellwig <hch@lst.de>
Wed, 18 Sep 2024 05:30:05 +0000 (07:30 +0200)
committerCarlos Maiolino <cem@kernel.org>
Mon, 7 Oct 2024 06:00:11 +0000 (08:00 +0200)
commita5f73342abe1f796140f6585e43e2aa7bc1b7975
treeb8e245c58ea92c94514403e68a15f0f0fd6a893a
parent346c1d46d4c631c0c88592d371f585214d714da4
xfs: distinguish extra split from real ENOSPC from xfs_attr3_leaf_split

xfs_attr3_leaf_split propagates the need for an extra btree split as
-ENOSPC to it's only caller, but the same return value can also be
returned from xfs_da_grow_inode when it fails to find free space.

Distinguish the two cases by returning 1 for the extra split case instead
of overloading -ENOSPC.

This can be triggered relatively easily with the pending realtime group
support and a file system with a lot of small zones that use metadata
space on the main device.  In this case every about 5-10th run of
xfs/538 runs into the following assert:

ASSERT(oldblk->magic == XFS_ATTR_LEAF_MAGIC);

in xfs_attr3_leaf_split caused by an allocation failure.  Note that
the allocation failure is caused by another bug that will be fixed
subsequently, but this commit at least sorts out the error handling.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/libxfs/xfs_attr_leaf.c
fs/xfs/libxfs/xfs_da_btree.c