]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_repair: skip mount time quotacheck if our quotacheck was ok
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 30 Jul 2020 00:15:27 +0000 (20:15 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Thu, 30 Jul 2020 00:15:27 +0000 (20:15 -0400)
If we verified that the incore quota counts match the ondisk quota
contents, we can leave the CHKD flags set so that the next mount doesn't
have to repeat the quotacheck.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
repair/quotacheck.c
repair/quotacheck.h
repair/xfs_repair.c

index 481a1289d703e901c37403db9c61c558ae7701c8..0df1f2be5bc2d58108774087d53ea6d27c2a6cc7 100644 (file)
@@ -24,6 +24,16 @@ void quotacheck_skip(void)
  */
 static uint16_t chkd_flags;
 
+/*
+ * Return CHKD flags for the quota types that we checked.  If we encountered
+ * any errors at all, return zero.
+ */
+uint16_t
+quotacheck_results(void)
+{
+       return chkd_flags;
+}
+
 /* Global incore dquot tree */
 struct qc_dquots {
        pthread_mutex_t         lock;
index 08e11d17e6eb88065dba82da16d6036d605615f9..d745696fad37633d455728bd13be99cf7ee36197 100644 (file)
@@ -9,6 +9,7 @@
 void quotacheck_skip(void);
 void quotacheck_adjust(struct xfs_mount *mp, xfs_ino_t ino);
 void quotacheck_verify(struct xfs_mount *mp, unsigned int type);
+uint16_t quotacheck_results(void);
 int quotacheck_setup(struct xfs_mount *mp);
 void quotacheck_teardown(void);
 
index a787da4c8ec5bfea079ff6ec4692e2856a544f3f..d687edeaaaf3ef326c67c891b9ef526778c00364 100644 (file)
@@ -1106,7 +1106,7 @@ _("Warning:  project quota information would be cleared.\n"
 
        dsb = sbp->b_addr;
 
-       if (mp->m_sb.sb_qflags & XFS_ALL_QUOTA_CHKD) {
+       if ((mp->m_sb.sb_qflags & XFS_ALL_QUOTA_CHKD) != quotacheck_results()) {
                do_warn(_("Note - quota info will be regenerated on next "
                        "quota mount.\n"));
                dsb->sb_qflags &= cpu_to_be16(~(XFS_UQUOTA_CHKD |