]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
xfs_repair: do not count metadata directory files when doing quotacheck
authorDarrick J. Wong <djwong@kernel.org>
Thu, 29 Jun 2023 20:23:16 +0000 (13:23 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Wed, 22 Nov 2023 23:03:32 +0000 (15:03 -0800)
Previously, we stated that files in the metadata directory tree are not
counted in the dquot information.  Fix the offline quotacheck code in
xfs_repair and xfs_check to reflect this.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
db/check.c
repair/quotacheck.c

index ae5274711617f0356671fb061389f7751597e7ca..190565074b699975dd722efa25b528b71523d641 100644 (file)
@@ -3018,6 +3018,10 @@ process_inode(
                default:
                        break;
                }
+               /* Metadata directory files are not counted in quotas. */
+               if (dip->di_version >= 3 &&
+                   (dip->di_flags2 & cpu_to_be64(XFS_DIFLAG2_METADIR)))
+                       ic = 0;
                if (ic)
                        quota_add(&prid, &gid, &uid, 0, bc, ic, rc);
        }
index 4cb38db3ddd6d75c175fdd5350018cc7c61fdb0c..3abcd8ae9a073b1e0a50990d5f7b7f68aa3da345 100644 (file)
@@ -217,6 +217,10 @@ quotacheck_adjust(
                return;
        }
 
+       /* Metadata directory files aren't counted in quota. */
+       if (xfs_is_metadir_inode(ip))
+               goto out_rele;
+
        /* Count the file's blocks. */
        if (XFS_IS_REALTIME_INODE(ip))
                rtblks = qc_count_rtblocks(ip);
@@ -229,6 +233,7 @@ quotacheck_adjust(
        if (proj_dquots)
                qc_adjust(proj_dquots, ip->i_projid, blocks, rtblks);
 
+out_rele:
        libxfs_irele(ip);
 }