diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2019-11-06 02:33:56 +0300 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2019-11-06 19:07:41 +0300 |
commit | 8ef34723eff08806e3e9c1c756c62a3cb482a3b8 (patch) | |
tree | 910a606ad3a211a09a42131cde6e63bbb883b69b /fs/xfs/scrub/fscounters.c | |
parent | 9842b56cd406828eb1030617e8ef252fec90be4d (diff) | |
download | linux-8ef34723eff08806e3e9c1c756c62a3cb482a3b8.tar.xz |
xfs: add missing early termination checks to record scrubbing functions
Scrubbing directories, quotas, and fs counters all involve iterating
some collection of metadata items. The per-item scrub functions for
these three are missing some of the components they need to be able to
check for a fatal signal and terminate early.
Per-item scrub functions need to call xchk_should_terminate to look for
fatal signals, and they need to check the scrub context's corruption
flag because there's no point in continuing a scan once we've decided
the data structure is bad. Add both of these where missing.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/scrub/fscounters.c')
-rw-r--r-- | fs/xfs/scrub/fscounters.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/xfs/scrub/fscounters.c b/fs/xfs/scrub/fscounters.c index 98f82d7c8b40..7251c66a82c9 100644 --- a/fs/xfs/scrub/fscounters.c +++ b/fs/xfs/scrub/fscounters.c @@ -104,7 +104,7 @@ next_loop_perag: pag = NULL; error = 0; - if (fatal_signal_pending(current)) + if (xchk_should_terminate(sc, &error)) break; } @@ -163,6 +163,7 @@ xchk_fscount_aggregate_agcounts( uint64_t delayed; xfs_agnumber_t agno; int tries = 8; + int error = 0; retry: fsc->icount = 0; @@ -196,10 +197,13 @@ retry: xfs_perag_put(pag); - if (fatal_signal_pending(current)) + if (xchk_should_terminate(sc, &error)) break; } + if (error) + return error; + /* * The global incore space reservation is taken from the incore * counters, so leave that out of the computation. |