Hi all, This series uses the inode scanner and live update hook functionality introduced in the last patchset to implement quotacheck on a live filesystem. The quotacheck scrubber builds an incore copy of the dquot resource usage counters and compares it to the live dquots to report discrepancies. If the user chooses to repair the quota counters, the repair function visits each incore dquot to update the counts from the live information. The live update hooks are key to keeping the incore copy up to date. If you're going to start using this code, I strongly recommend pulling from my git trees, which are linked below. This has been running on the djcloud for months with no problems. Enjoy! Comments and questions are, as always, welcome. --D kernel git tree: https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=repair-quotacheck xfsprogs git tree: https://git.kernel.org/cgit/linux/kernel/git/djwong/xfsprogs-dev.git/log/?h=repair-quotacheck fstests git tree: https://git.kernel.org/cgit/linux/kernel/git/djwong/xfstests-dev.git/log/?h=repair-quotacheck --- fs/xfs/Makefile | 2 fs/xfs/libxfs/xfs_fs.h | 4 fs/xfs/libxfs/xfs_health.h | 4 fs/xfs/scrub/common.c | 47 ++ fs/xfs/scrub/common.h | 11 fs/xfs/scrub/fscounters.c | 2 fs/xfs/scrub/health.c | 1 fs/xfs/scrub/quotacheck.c | 862 ++++++++++++++++++++++++++++++++++++++ fs/xfs/scrub/quotacheck.h | 76 +++ fs/xfs/scrub/quotacheck_repair.c | 261 ++++++++++++ fs/xfs/scrub/repair.c | 46 ++ fs/xfs/scrub/repair.h | 5 fs/xfs/scrub/scrub.c | 9 fs/xfs/scrub/scrub.h | 10 fs/xfs/scrub/stats.c | 1 fs/xfs/scrub/trace.h | 30 + fs/xfs/scrub/xfarray.h | 19 + fs/xfs/xfs_health.c | 1 fs/xfs/xfs_inode.c | 21 + fs/xfs/xfs_inode.h | 2 fs/xfs/xfs_qm.c | 23 + fs/xfs/xfs_qm.h | 16 + fs/xfs/xfs_qm_bhv.c | 1 fs/xfs/xfs_quota.h | 45 ++ fs/xfs/xfs_trans_dquot.c | 158 +++++++ 25 files changed, 1632 insertions(+), 25 deletions(-) create mode 100644 fs/xfs/scrub/quotacheck.c create mode 100644 fs/xfs/scrub/quotacheck.h create mode 100644 fs/xfs/scrub/quotacheck_repair.c