mirror of
https://github.com/torvalds/linux.git
synced 2026-09-13 15:40:03 +02:00
xfs: signal inode btree xref error if get_rec returns an error
LOLLM points out that xchk_finobt_xref_inobt and xchk_inobt_xref_finobt
both ignore errors being returned from the xfs_btree_get_rec function
and proceed with a (possibly stale) "true" value for has_record. If the
*simple* btree record checks fail during cross-referencing, we can
immediately conclude that there's a cross-referncing error in the other
btree. On those grounds, we can bubble up the returned error instead of
wasting time cross-referencing with garbage.
Cc: stable@vger.kernel.org # v6.4
Fixes: bc0f3b5546 ("xfs: directly cross-reference the inode btrees with each other")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Assisted-by: LOLLM # finding obvious bugs
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
This commit is contained in:
parent
1a441c6842
commit
8c71ad4d4f
|
|
@ -85,6 +85,8 @@ xchk_inobt_xref_finobt(
|
|||
goto no_record;
|
||||
|
||||
error = xfs_inobt_get_rec(cur, &frec, &has_record);
|
||||
if (error)
|
||||
return error;
|
||||
if (!has_record)
|
||||
return -EFSCORRUPTED;
|
||||
|
||||
|
|
@ -188,6 +190,8 @@ xchk_finobt_xref_inobt(
|
|||
goto no_record;
|
||||
|
||||
error = xfs_inobt_get_rec(cur, &irec, &has_record);
|
||||
if (error)
|
||||
return error;
|
||||
if (!has_record)
|
||||
return -EFSCORRUPTED;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user