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

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