summaryrefslogtreecommitdiff
path: root/fs/xfs/scrub/scrub.c
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2019-01-16 10:12:14 -0800
committerDarrick J. Wong <darrick.wong@oracle.com>2019-04-15 17:02:47 -0700
commitf7c78f9ef1453a700a41e2d205fc61239e8f994a (patch)
treeafb8972a7e8ac31d5cf84b0461b514638fbb4d93 /fs/xfs/scrub/scrub.c
parent051c747b550341dbe495faf7afc5dc238bcb9858 (diff)
xfs: introduce online scrub freeze
Introduce a new 'online scrub freeze' that we can use to lock out all filesystem modifications and background activity so that we can perform global scans in order to rebuild metadata. This introduces a new IFLAG to the scrub ioctl to indicate that userspace is willing to allow a freeze. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/scrub/scrub.c')
-rw-r--r--fs/xfs/scrub/scrub.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/xfs/scrub/scrub.c b/fs/xfs/scrub/scrub.c
index 1e614cf0894e..58492374d20a 100644
--- a/fs/xfs/scrub/scrub.c
+++ b/fs/xfs/scrub/scrub.c
@@ -171,6 +171,8 @@ xchk_teardown(
struct xfs_inode *ip_in,
int error)
{
+ int err2;
+
xchk_ag_free(sc, &sc->sa);
if (sc->tp) {
if (error == 0 && (sc->sm->sm_flags & XFS_SCRUB_IFLAG_REPAIR))
@@ -187,6 +189,12 @@ xchk_teardown(
xfs_irele(sc->ip);
sc->ip = NULL;
}
+ if (sc->flags & XCHK_FS_FROZEN) {
+ err2 = xchk_fs_thaw(sc);
+ if (!error && err2)
+ error = err2;
+ sc->flags &= ~XCHK_FS_FROZEN;
+ }
if (sc->flags & XCHK_HAS_QUOTAOFFLOCK) {
mutex_unlock(&sc->mp->m_quotainfo->qi_quotaofflock);
sc->flags &= ~XCHK_HAS_QUOTAOFFLOCK;