Hi all, This series starts by implementing quick repairs for obvious problems with quota records. Next, we implement a new scrubber to check all quota counters in the system. This is done by walking all inodes (just like mount time quotacheck) but with the added twist that the online quotacheck code hooks the regular quota update mechanism to stay abreast of changes to quota counters, thereby ensuring that the quota counters are always up to date. The series ends by adding the ability to commit the new counters to the dquots. If you're going to start using this mess, you probably ought to just pull from my git trees, which are linked below. This is an extraordinary way to destroy everything. 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-quota xfsprogs git tree: https://git.kernel.org/cgit/linux/kernel/git/djwong/xfsprogs-dev.git/log/?h=repair-quota fstests git tree: https://git.kernel.org/cgit/linux/kernel/git/djwong/xfstests-dev.git/log/?h=repair-quota --- fs/xfs/Kconfig | 1 fs/xfs/Makefile | 11 fs/xfs/libxfs/xfs_bmap.c | 41 ++ fs/xfs/libxfs/xfs_bmap.h | 3 fs/xfs/libxfs/xfs_fs.h | 3 fs/xfs/scrub/bmap_repair.c | 16 + fs/xfs/scrub/common.c | 11 fs/xfs/scrub/common.h | 16 + fs/xfs/scrub/quota.c | 12 - fs/xfs/scrub/quota.h | 11 fs/xfs/scrub/quota_repair.c | 401 ++++++++++++++++++ fs/xfs/scrub/quotacheck.c | 838 ++++++++++++++++++++++++++++++++++++++ fs/xfs/scrub/quotacheck.h | 73 +++ fs/xfs/scrub/quotacheck_repair.c | 247 +++++++++++ fs/xfs/scrub/repair.c | 80 ++++ fs/xfs/scrub/repair.h | 12 + fs/xfs/scrub/scrub.c | 20 + fs/xfs/scrub/scrub.h | 12 + fs/xfs/scrub/trace.c | 1 fs/xfs/scrub/trace.h | 27 + fs/xfs/xfs_inode.c | 26 - fs/xfs/xfs_iwalk.c | 118 +++++ fs/xfs/xfs_iwalk.h | 3 fs/xfs/xfs_mount.c | 43 ++ fs/xfs/xfs_mount.h | 10 fs/xfs/xfs_qm.c | 18 - fs/xfs/xfs_qm.h | 15 + fs/xfs/xfs_quota.h | 19 + fs/xfs/xfs_trans_dquot.c | 72 +++ 29 files changed, 2100 insertions(+), 60 deletions(-) create mode 100644 fs/xfs/scrub/quota.h create mode 100644 fs/xfs/scrub/quota_repair.c 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