[quota/f14] Improve quotacheck error message

Petr Pisar ppisar at fedoraproject.org
Fri Jul 15 08:56:53 UTC 2011


commit 1c6d02e6cb0167f7efbe835296a881261ddd879d
Author: Petr Písař <ppisar at redhat.com>
Date:   Fri Jul 15 08:56:13 2011 +0200

    Improve quotacheck error message

 ...f_name-does-not-check-quota-file-presence.patch |   41 ++++++++++++++++++++
 quota.spec                                         |    4 ++
 2 files changed, 45 insertions(+), 0 deletions(-)
---
diff --git a/quota-3.17-get_qf_name-does-not-check-quota-file-presence.patch b/quota-3.17-get_qf_name-does-not-check-quota-file-presence.patch
new file mode 100644
index 0000000..15af515
--- /dev/null
+++ b/quota-3.17-get_qf_name-does-not-check-quota-file-presence.patch
@@ -0,0 +1,41 @@
+From 101bfc92288287d9e48c08078f3c7df90c1cc511 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar at redhat.com>
+Date: Fri, 1 Jul 2011 10:22:10 +0200
+Subject: [PATCH 2/2] get_qf_name() does not check quota file presence
+
+Old error messsage stated a quota file does not exist despite fact
+get_qf_name() does not check the file existence. It constructs the
+file name only.
+
+This lead to misleading message when running initial `quotacheck -c'
+on extended file system mounted with usrquota option only.
+
+Signed-off-by: Jan Kara <jack at suse.cz>
+
+Petr Pisar: Back-ported to 3.17
+---
+ quotacheck.c |    4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/quotacheck.c b/quotacheck.c
+index 26fb035..01d6cac 100644
+--- a/quotacheck.c
++++ b/quotacheck.c
+@@ -862,12 +862,12 @@ static int sub_quota_file(struct mntent *mnt, int qtype, int ftype)
+ 
+ 	debug(FL_DEBUG, _("Substracting space used by old %s quota file.\n"), type2name(ftype));
+ 	if (get_qf_name(mnt, ftype, 1 << cfmt, 0, &filename) < 0) {
+-		debug(FL_VERBOSE, _("Old %s file not found. Usage will not be substracted.\n"), type2name(ftype));
++		debug(FL_VERBOSE, _("Old %s file name could not been determined. Usage will not be substracted.\n"), type2name(ftype));
+ 		return 0;
+ 	}
+ 
+ 	if (stat(filename, &st) < 0) {
+-		debug(FL_VERBOSE, _("Cannot stat old %s quota file: %s\n"), type2name(ftype), strerror(errno));
++		debug(FL_VERBOSE, _("Cannot stat old %s quota file %s: %s. Usage will not be substracted.\n"), type2name(ftype), filename, strerror(errno));
+ 		free(filename);
+ 		return 0;
+ 	}
+-- 
+1.7.6
+
diff --git a/quota.spec b/quota.spec
index 7998f70..c0072fd 100644
--- a/quota.spec
+++ b/quota.spec
@@ -35,6 +35,8 @@ Patch11: quota-3.17-use-proc-mounts-for-mountpoint-scanning.patch
 Patch12: quota-4.00_pre1-Make-dirname-static.patch
 # In upstream 4.00_pre2 (SF#3347047), bug #717982
 Patch13: quota-3.17-Report-quotacheck-failures-by-return-code.patch
+# In upstream 4.00_pre2 (SF#3347047), bug #717982
+Patch14: quota-3.17-get_qf_name-does-not-check-quota-file-presence.patch
 
 %description
 The quota package contains system administration tools for monitoring
@@ -71,6 +73,7 @@ on remote machines.
 %patch11 -p1 -b .use_proc_mounts
 %patch12 -p1 -b .static_dirname
 %patch13 -p1 -b .report_quotacheck_failures
+%patch14 -p1 -b .improve_quotacheck_message
 
 #fix typos/mistakes in localized documentation
 for pofile in $(find ./po/*.p*)
@@ -142,6 +145,7 @@ rm -rf %{buildroot}
 %changelog
 * Fri Jul 15 2011 Petr Pisar <ppisar at redhat.com> - 1:3.17-17
 - Report quotacheck failures by return code (bug #717982)
+- Improve quotacheck error message (bug #717982)
 
 * Thu May 12 2011 Petr Pisar <ppisar at redhat.com> - 1:3.17-16
 - Make dirname static to work with nss_db (bug #703567)


More information about the scm-commits mailing list