Skip to content

Commit 16c9de5

Browse files
author
Darrick J. Wong
committed
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 <[email protected]> Reviewed-by: Brian Foster <[email protected]>
1 parent 676a659 commit 16c9de5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/xfs/scrub/common.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ __xchk_process_error(
7474
return true;
7575
case -EDEADLOCK:
7676
/* Used to restart an op with deadlock avoidance. */
77-
trace_xchk_deadlock_retry(sc->ip, sc->sm, *error);
77+
trace_xchk_deadlock_retry(
78+
sc->ip ? sc->ip : XFS_I(file_inode(sc->file)),
79+
sc->sm, *error);
7880
break;
7981
case -EFSBADCRC:
8082
case -EFSCORRUPTED:

0 commit comments

Comments
 (0)