Optimize out useless checking of file systems with hidden quota files

This commit is contained in:
Petr Písař 2019-11-05 11:58:24 +01:00
parent 796c4e4310
commit 9e26235974
2 changed files with 50 additions and 1 deletions

View File

@ -0,0 +1,42 @@
From 61e57e73a6c63ad50825182ca80bc2a5fcb3e1e2 Mon Sep 17 00:00:00 2001
From: Jan Kara <jack@suse.cz>
Date: Tue, 30 Jul 2019 17:25:46 +0200
Subject: [PATCH] quotacheck: Skip checking of filesystems with hidded quota
files early
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Currently when filesystem tracks quotas in hidden quota files (but is
also capable of tracking it in regular files), we scan the whole
filesystem and only after that find out we cannot actually make use of
newly created quota files. Just detect this case before scanning the fs
and skip it.
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
quotacheck.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/quotacheck.c b/quotacheck.c
index 2cdf475..1311c10 100644
--- a/quotacheck.c
+++ b/quotacheck.c
@@ -1181,11 +1181,11 @@ static int check_all(void)
continue;
}
cfmt = fmt;
- if (uwant && me_hasquota(mnt, USRQUOTA))
+ if (uwant && me_hasquota(mnt, USRQUOTA) && mnt->me_qfmt[USRQUOTA] != QF_META)
ucheck = 1;
else
ucheck = 0;
- if (gwant && me_hasquota(mnt, GRPQUOTA))
+ if (gwant && me_hasquota(mnt, GRPQUOTA) && mnt->me_qfmt[GRPQUOTA] != QF_META)
gcheck = 1;
else
gcheck = 0;
--
2.21.0

View File

@ -13,7 +13,7 @@
Name: quota
Epoch: 1
Version: 4.05
Release: 5%{?dist}
Release: 6%{?dist}
Summary: System administration tools for monitoring users' disk usage
# quota_nld.c, quotaio_xfs.h: GPLv2
# bylabel.c copied from util-linux: GPLv2+
@ -80,6 +80,9 @@ Patch9: quota-4.05-COPYING-Update-mailing-address.patch
# Move quota_nld.pid file to /run,
# <https://sourceforge.net/p/linuxquota/patches/49/>, in upstream after 4.05
Patch10: quota-4.05-Make-a-directory-for-quota_nld-PID-file-configurable.patch
# Optimize out useless checking of file systems with hidden quota files,
# in upstream after 4.05
Patch11: quota-4.05-quotacheck-Skip-checking-of-filesystems-with-hidded-.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: bash
@ -210,6 +213,7 @@ Linux/UNIX environment.
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
# Regenerate build scripts
autoreconf -f -i
@ -359,6 +363,9 @@ make check
%changelog
* Tue Nov 05 2019 Petr Pisar <ppisar@redhat.com> - 1:4.05-6
- Optimize out useless checking of file systems with hidden quota files
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.05-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild