From: Darrick J. Wong Date: Wed, 12 May 2021 23:41:13 +0000 (-0700) Subject: xfs: fix deadlock retry tracepoint arguments X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=16c9de54dc868c121918f2ae91e46330f919049f;p=linux.git xfs: fix deadlock retry tracepoint arguments sc->ip is the inode that's being scrubbed, which means that it's not set for scrub types that don't involve inodes. If one of those scrubbers (e.g. inode btrees) returns EDEADLOCK, we'll trip over the null pointer. Fix that by reporting either the file being examined or the file that was used to call scrub. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster --- diff --git a/fs/xfs/scrub/common.c b/fs/xfs/scrub/common.c index aa874607618a2..be38c960da858 100644 --- a/fs/xfs/scrub/common.c +++ b/fs/xfs/scrub/common.c @@ -74,7 +74,9 @@ __xchk_process_error( return true; case -EDEADLOCK: /* Used to restart an op with deadlock avoidance. */ - trace_xchk_deadlock_retry(sc->ip, sc->sm, *error); + trace_xchk_deadlock_retry( + sc->ip ? sc->ip : XFS_I(file_inode(sc->file)), + sc->sm, *error); break; case -EFSBADCRC: case -EFSCORRUPTED: