xfs: do not count metadata directory files when doing online quotacheck
authorDarrick J. Wong <djwong@kernel.org>
Mon, 4 Nov 2024 04:18:58 +0000 (20:18 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 5 Nov 2024 21:38:33 +0000 (13:38 -0800)
Previously, we stated that files in the metadata directory tree are not
counted in the dquot information.  Fix the online quotacheck code to
reflect this.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/scrub/quotacheck.c

index c77eb2d..dc4033b 100644 (file)
@@ -398,10 +398,13 @@ xqcheck_collect_inode(
        bool                    isreg = S_ISREG(VFS_I(ip)->i_mode);
        int                     error = 0;
 
-       if (xfs_is_quota_inode(&tp->t_mountp->m_sb, ip->i_ino)) {
+       if (xfs_is_metadir_inode(ip) ||
+           xfs_is_quota_inode(&tp->t_mountp->m_sb, ip->i_ino)) {
                /*
                 * Quota files are never counted towards quota, so we do not
-                * need to take the lock.
+                * need to take the lock.  Files do not switch between the
+                * metadata and regular directory trees without a reallocation,
+                * so we do not need to ILOCK them either.
                 */
                xchk_iscan_mark_visited(&xqc->iscan, ip);
                return 0;