From: Carlos Maiolino The tracepoint doesn't help much if we find an invalid right record. Move it before we check the record so it can still be printed even if we end up jumping to the error label. Signed-off-by: Carlos Maiolino --- V3: No changes V2: Initialize rmap records during definition so we can safely use them in the tracepoints Signed-off-by: Carlos Maiolino fs/xfs/libxfs/xfs_rmap.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/fs/xfs/libxfs/xfs_rmap.c b/fs/xfs/libxfs/xfs_rmap.c index 14aef87837a9..aad6e7c0e1c9 100644 --- a/fs/xfs/libxfs/xfs_rmap.c +++ b/fs/xfs/libxfs/xfs_rmap.c @@ -1024,8 +1024,8 @@ xfs_rmap_map( const struct xfs_owner_info *oinfo) { struct xfs_mount *mp = cur->bc_mp; - struct xfs_rmap_irec ltrec; - struct xfs_rmap_irec gtrec; + struct xfs_rmap_irec ltrec = {0}; + struct xfs_rmap_irec gtrec = {0}; int have_gt; int have_lt; int error = 0; @@ -1082,6 +1082,12 @@ xfs_rmap_map( error = xfs_rmap_get_rec(cur, >rec, &have_gt); if (error) goto out_error; + + trace_xfs_rmap_find_right_neighbor_result(cur, + gtrec.rm_startblock, gtrec.rm_blockcount, + gtrec.rm_owner, gtrec.rm_offset, + gtrec.rm_flags); + if (XFS_IS_CORRUPT(mp, have_gt != 1)) { xfs_btree_mark_sick(cur); error = -EFSCORRUPTED; @@ -1092,10 +1098,6 @@ xfs_rmap_map( error = -EFSCORRUPTED; goto out_error; } - trace_xfs_rmap_find_right_neighbor_result(cur, - gtrec.rm_startblock, gtrec.rm_blockcount, - gtrec.rm_owner, gtrec.rm_offset, - gtrec.rm_flags); if (!xfs_rmap_is_mergeable(>rec, owner, flags)) have_gt = 0; } -- 2.56.1