6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Darrick J. Wong commit 1ccc8f553d885d49c1bfe141ea1f331511940b3a upstream. LOLLM complains that the error processing functions in scrub will sometimes zero out *error before recording a tracepoint. This makes diagnosing problems harder, so let's fix that. Cc: stable@vger.kernel.org # v4.15 Fixes: 4700d22980d459 ("xfs: create helpers to record and deal with scrub problems") Signed-off-by: Darrick J. Wong Assisted-by: LOLLM # finding obvious bugs Reviewed-by: Christoph Hellwig Signed-off-by: Carlos Maiolino Signed-off-by: Greg Kroah-Hartman --- fs/xfs/scrub/btree.c | 8 +++++++- fs/xfs/scrub/common.c | 7 +++++-- fs/xfs/scrub/dabtree.c | 6 +++++- 3 files changed, 17 insertions(+), 4 deletions(-) --- a/fs/xfs/scrub/btree.c +++ b/fs/xfs/scrub/btree.c @@ -46,8 +46,14 @@ __xchk_btree_process_error( case -ENODATA: /* Note the badness but don't abort. */ sc->sm->sm_flags |= errflag; + if (cur->bc_ops->type == XFS_BTREE_TYPE_INODE) + trace_xchk_ifork_btree_op_error(sc, cur, level, + *error, ret_ip); + else + trace_xchk_btree_op_error(sc, cur, level, + *error, ret_ip); *error = 0; - fallthrough; + break; default: if (cur->bc_ops->type == XFS_BTREE_TYPE_INODE) trace_xchk_ifork_btree_op_error(sc, cur, level, --- a/fs/xfs/scrub/common.c +++ b/fs/xfs/scrub/common.c @@ -102,8 +102,9 @@ __xchk_process_error( case -ENODATA: /* Note the badness but don't abort. */ sc->sm->sm_flags |= errflag; + trace_xchk_op_error(sc, agno, bno, *error, ret_ip); *error = 0; - fallthrough; + break; default: trace_xchk_op_error(sc, agno, bno, *error, ret_ip); break; @@ -167,8 +168,10 @@ __xchk_fblock_process_error( case -ENODATA: /* Note the badness but don't abort. */ sc->sm->sm_flags |= errflag; + trace_xchk_file_op_error(sc, whichfork, offset, *error, + ret_ip); *error = 0; - fallthrough; + break; default: trace_xchk_file_op_error(sc, whichfork, offset, *error, ret_ip); --- a/fs/xfs/scrub/dabtree.c +++ b/fs/xfs/scrub/dabtree.c @@ -49,8 +49,12 @@ xchk_da_process_error( case -ENODATA: /* Note the badness but don't abort. */ sc->sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT; + trace_xchk_file_op_error(sc, ds->dargs.whichfork, + xfs_dir2_da_to_db(ds->dargs.geo, + ds->state->path.blk[level].blkno), + *error, __return_address); *error = 0; - fallthrough; + break; default: trace_xchk_file_op_error(sc, ds->dargs.whichfork, xfs_dir2_da_to_db(ds->dargs.geo,