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-02-04 09:31:15 -0800
commitab1837abcb2ed4bfe740ca87175666779eebcf40 (patch)
tree1d70eebd4a465a3e772b89696ea88fdec1a1cc56 /fs/xfs/scrub/scrub.c
parent242f84fd671c2f7d4cdd8c743b24e57ab12e6dc7 (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 e08f588d518f..3b945f0ffbf6 100644
--- a/fs/xfs/scrub/scrub.c
+++ b/fs/xfs/scrub/scrub.c
@@ -170,6 +170,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))
@@ -186,6 +188,12 @@ xchk_teardown(
xfs_irele(sc->ip);
sc->ip = NULL;
}
+ if (sc->fs_frozen) {
+ err2 = xfs_scrub_fs_thaw(sc);
+ if (!error && err2)
+ error = err2;
+ sc->fs_frozen = false;
+ }
if (sc->has_quotaofflock)
mutex_unlock(&sc->mp->m_quotainfo->qi_quotaofflock);
if (sc->buf) {