diff options
author | Darrick J. Wong <djwong@kernel.org> | 2021-08-06 21:05:42 +0300 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2021-08-09 20:52:19 +0300 |
commit | 6f6490914d9b712004ddad648e47b1bf22647978 (patch) | |
tree | 08c5cfeaa4701b2e4d9efdce14faccb4ffdd5687 /fs/xfs/scrub | |
parent | 01e8f379a4895a9a173391408db4fb49ec91e148 (diff) | |
download | linux-6f6490914d9b712004ddad648e47b1bf22647978.tar.xz |
xfs: don't run speculative preallocation gc when fs is frozen
Now that we have the infrastructure to switch background workers on and
off at will, fix the block gc worker code so that we don't actually run
the worker when the filesystem is frozen, same as we do for deferred
inactivation.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/scrub')
-rw-r--r-- | fs/xfs/scrub/common.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/xfs/scrub/common.c b/fs/xfs/scrub/common.c index 06b697f72f23..e86854171b0c 100644 --- a/fs/xfs/scrub/common.c +++ b/fs/xfs/scrub/common.c @@ -893,11 +893,12 @@ xchk_start_reaping( struct xfs_scrub *sc) { /* - * Readonly filesystems do not perform inactivation, so there's no - * need to restart the worker. + * Readonly filesystems do not perform inactivation or speculative + * preallocation, so there's no need to restart the workers. */ - if (!(sc->mp->m_flags & XFS_MOUNT_RDONLY)) + if (!(sc->mp->m_flags & XFS_MOUNT_RDONLY)) { xfs_inodegc_start(sc->mp); - xfs_blockgc_start(sc->mp); + xfs_blockgc_start(sc->mp); + } sc->flags &= ~XCHK_REAPING_DISABLED; } |