| From e5bde75a816b3549942f4b09a8bf09006b7ea9de Mon Sep 17 00:00:00 2001 | |
| From: "Darrick J. Wong" <djwong@kernel.org> | |
| Date: Sun, 4 Oct 2026 22:56:51 -0700 | |
| Subject: xfs: propagate errors while checking null siblings | |
| From: Darrick J. Wong <djwong@kernel.org> | |
| commit e5bde75a816b3549942f4b09a8bf09006b7ea9de upstream. | |
| LOLLM observes that if xfs_da3_path_shift returns an error here, scrub | |
| doesn't handle it the way that it handles most runtime errors. Instead, | |
| it drops the error and keeps going, even though that's not how that's | |
| supposed to work. Fix that by calling xchk_da_process_error to set | |
| corruption flags and then jump out of the flow of execution. | |
| Cc: stable@vger.kernel.org # v4.15 | |
| Fixes: 7c4a07a424c18d ("xfs: scrub directory/attribute btrees") | |
| 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> | |
| Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
| --- | |
| fs/xfs/scrub/dabtree.c | 5 +++-- | |
| 1 file changed, 3 insertions(+), 2 deletions(-) | |
| --- a/fs/xfs/scrub/dabtree.c | |
| +++ b/fs/xfs/scrub/dabtree.c | |
| @@ -236,9 +236,10 @@ xchk_da_btree_block_check_sibling( | |
| if (sibling == 0) { | |
| error = xfs_da3_path_shift(ds->state, altpath, direction, | |
| false, &retval); | |
| - if (error == 0 && retval == 0) | |
| + if (!xchk_da_process_error(ds, level, &error)) | |
| + goto out; | |
| + if (retval == 0) | |
| xchk_da_set_corrupt(ds, level); | |
| - error = 0; | |
| goto out; | |
| } | |