diff options
author | Darrick J. Wong <djwong@kernel.org> | 2023-04-11 19:00:02 -0700 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2023-04-11 19:00:02 -0700 |
commit | 39ab26d59f039c6190bbaa8118a8f0ffed84492a (patch) | |
tree | 7777c911884465946304bad70f194e0e0c48f0c6 /fs/xfs/scrub/rmap.c | |
parent | 2b30cc0bf0589d1ea0506c019b9b81de77535c87 (diff) |
xfs: return a failure address from xfs_rmap_irec_offset_unpack
Currently, xfs_rmap_irec_offset_unpack returns only 0 or -EFSCORRUPTED.
Change this function to return the code address of a failed conversion
in preparation for the next patch, which standardizes localized record
checking and reporting code.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/scrub/rmap.c')
-rw-r--r-- | fs/xfs/scrub/rmap.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/xfs/scrub/rmap.c b/fs/xfs/scrub/rmap.c index c6e47ef4c79b..9f661c487beb 100644 --- a/fs/xfs/scrub/rmap.c +++ b/fs/xfs/scrub/rmap.c @@ -100,11 +100,11 @@ xchk_rmapbt_rec( bool is_unwritten; bool is_bmbt; bool is_attr; - int error; - error = xfs_rmap_btrec_to_irec(rec, &irec); - if (!xchk_btree_process_error(bs->sc, bs->cur, 0, &error)) - goto out; + if (xfs_rmap_btrec_to_irec(rec, &irec) != NULL) { + xchk_btree_set_corrupt(bs->sc, bs->cur, 0); + return 0; + } /* Check extent. */ if (irec.rm_startblock + irec.rm_blockcount <= irec.rm_startblock) @@ -159,8 +159,7 @@ xchk_rmapbt_rec( } xchk_rmapbt_xref(bs->sc, &irec); -out: - return error; + return 0; } /* Scrub the rmap btree for some AG. */ |