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