Blame SOURCES/quota-4.01-Do-not-fiddle-with-quota-files-on-XFS-and-GFS.patch

dba0f0
From 5f7b9d139d64117abc4dcd66d2fbac99c070d7ce Mon Sep 17 00:00:00 2001
dba0f0
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
dba0f0
Date: Thu, 31 Jan 2013 12:58:59 +0100
dba0f0
Subject: [PATCH] Do not fiddle with quota files on XFS and GFS
dba0f0
MIME-Version: 1.0
dba0f0
Content-Type: text/plain; charset=UTF-8
dba0f0
Content-Transfer-Encoding: 8bit
dba0f0
dba0f0
XFS and GFS have no quota files. Skip unnecessary examination and
dba0f0
rename of these files when running quotacheck.
dba0f0
dba0f0
Signed-off-by: Petr Písař <ppisar@redhat.com>
dba0f0
Signed-off-by: Jan Kara <jack@suse.cz>
dba0f0
---
dba0f0
 quotacheck.c | 7 +++++++
dba0f0
 1 file changed, 7 insertions(+)
dba0f0
dba0f0
diff --git a/quotacheck.c b/quotacheck.c
dba0f0
index 0d0d4b2..e047825 100644
dba0f0
--- a/quotacheck.c
dba0f0
+++ b/quotacheck.c
dba0f0
@@ -828,6 +828,9 @@ static int dump_to_file(struct mount_entry *mnt, int type)
dba0f0
 		return -1;
dba0f0
 	}
dba0f0
 	debug(FL_DEBUG, _("Data dumped.\n"));
dba0f0
+	/* Moving of quota files doesn't apply to GFS2 or XFS */
dba0f0
+	if (cfmt == QF_XFS)
dba0f0
+		return 0;
dba0f0
 	if (kern_quota_on(mnt, type, cfmt) >= 0) {	/* Quota turned on? */
dba0f0
 		char *filename;
dba0f0
 
dba0f0
@@ -871,6 +874,10 @@ static int sub_quota_file(struct mount_entry *mnt, int qtype, int ftype)
dba0f0
 	struct dquot *d;
dba0f0
 	qid_t id;
dba0f0
 
dba0f0
+	/* GFS2 and XFS do not have quota files. */
dba0f0
+	if (cfmt == QF_XFS)
dba0f0
+		return 0;
dba0f0
+
dba0f0
 	debug(FL_DEBUG, _("Substracting space used by old %s quota file.\n"), _(type2name(ftype)));
dba0f0
 	if (get_qf_name(mnt, ftype, cfmt, 0, &filename) < 0) {
dba0f0
 		debug(FL_VERBOSE, _("Old %s file name could not been determined. Usage will not be subtracted.\n"), _(type2name(ftype)));
dba0f0
-- 
dba0f0
1.8.1.2
dba0f0