xfs: add online scrub for superblock counters
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 26 Apr 2019 01:26:24 +0000 (18:26 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Tue, 30 Apr 2019 15:19:13 +0000 (08:19 -0700)
commit75efa57d0bf5fcf650a183f0ce0dc011ba8c4bc8
treed6dfd62d2680be7cdb73e61e857e833f12ae0a78
parent94079285756d66b1aded4e36d35452cb1f9c953a
xfs: add online scrub for superblock counters

Teach online scrub how to check the filesystem summary counters.  We use
the incore delalloc block counter along with the incore AG headers to
compute expected values for fdblocks, icount, and ifree, and then check
that the percpu counter is within a certain threshold of the expected
value.  This is done to avoid having to freeze or otherwise lock the
filesystem, which means that we're only checking that the counters are
fairly close, not that they're exactly correct.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
fs/xfs/Makefile
fs/xfs/libxfs/xfs_fs.h
fs/xfs/libxfs/xfs_types.c
fs/xfs/libxfs/xfs_types.h
fs/xfs/scrub/common.c
fs/xfs/scrub/common.h
fs/xfs/scrub/fscounters.c [new file with mode: 0644]
fs/xfs/scrub/health.c
fs/xfs/scrub/scrub.c
fs/xfs/scrub/scrub.h
fs/xfs/scrub/trace.h