xfs: online repair of quota and rt metadata files [v28.3]

XFS stores quota records and free space bitmap information in files.
 Add the necessary infrastructure to enable repairing metadata inodes and
 their forks, and then make it so that we can repair the file metadata
 for the rtbitmap.  Repairing the bitmap contents (and the summary file)
 is left for subsequent patchsets.
 
 We also add the ability to repair file metadata the quota files.  As
 part of these repairs, we also reinitialize the ondisk dquot records as
 necessary to get the incore dquots working.  We can also correct
 obviously bad dquot record attributes, but we leave checking the
 resource usage counts for the next patchsets.
 
 This has been running on the djcloud for months with no problems.  Enjoy!
 
 Signed-off-by: Darrick J. Wong <djwong@kernel.org>
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQQ2qTKExjcn+O1o2YRKO3ySh0YRpgUCZXzKBAAKCRBKO3ySh0YR
 pq7JAPwM5CRyw09Ys4iy1QO3iX6y4awKVONO/qIWKzGi56RRggEAoDYNXtx8Kvd8
 gQS/PdrDBdQrwdu5W2stUyPt6xPxqwM=
 =DNHN
 -----END PGP SIGNATURE-----

Merge tag 'repair-quota-6.8_2023-12-15' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux into xfs-6.8-mergeB

xfs: online repair of quota and rt metadata files

XFS stores quota records and free space bitmap information in files.
Add the necessary infrastructure to enable repairing metadata inodes and
their forks, and then make it so that we can repair the file metadata
for the rtbitmap.  Repairing the bitmap contents (and the summary file)
is left for subsequent patchsets.

We also add the ability to repair file metadata the quota files.  As
part of these repairs, we also reinitialize the ondisk dquot records as
necessary to get the incore dquots working.  We can also correct
obviously bad dquot record attributes, but we leave checking the
resource usage counts for the next patchsets.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>

* tag 'repair-quota-6.8_2023-12-15' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux:
  xfs: repair quotas
  xfs: improve dquot iteration for scrub
  xfs: check dquot resource timers
  xfs: check the ondisk space mapping behind a dquot
This commit is contained in:
Chandan Babu R 2023-12-16 08:53:55 +05:30
commit 98bdbf60cc
12 changed files with 1026 additions and 54 deletions