Improve quotacheck error message

This commit is contained in:
Petr Písař 2011-07-15 08:56:13 +02:00
parent 9f434c0180
commit 576e135390
2 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,39 @@
From 1c3bc6d34439f353ea00239dc1ca31239823bb4f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@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@suse.cz>
---
quotacheck.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/quotacheck.c b/quotacheck.c
index 112596b..d8515af 100644
--- a/quotacheck.c
+++ b/quotacheck.c
@@ -873,12 +873,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, 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

View File

@ -83,6 +83,8 @@ Patch32: quota-4.00_pre1-We-shouldn-t-pass-NULL-to-XGETQSTAT-quotactl-since-k.pa
Patch33: quota-4.00_pre1-Make-dirname-static.patch
# In upstream 4.00_pre2 (SF#3347047), bug #717982
Patch34: quota-4.00_pre1-Report-quotacheck-failures-by-return-code.patch
# In upstream 4.00_pre2 (SF#3347047), bug #717982
Patch35: quota-4.00_pre1-get_qf_name-does-not-check-quota-file-presence.patch
%description
@ -188,6 +190,7 @@ Linux/UNIX environment.
%patch32 -p1 -b .do_not_pass_null_to_XGETQSTAT
%patch33 -p1 -b .static_dirname
%patch34 -p1 -b .report_quotacheck_failures
%patch35 -p1 -b .improve_quotacheck_message
# quotactl(2) moved into `man-pages' package (bug #640590)
rm -f quotactl.2
# remove VCS files
@ -301,6 +304,7 @@ fi
%changelog
* Fri Jul 15 2011 Petr Pisar <ppisar@redhat.com> - 1:4.00-0.16.pre1
- Report quotacheck failures by return code (bug #717982)
- Improve quotacheck error message (bug #717982)
* Thu May 12 2011 Petr Pisar <ppisar@redhat.com> - 1:4.00-0.15.pre1
- Make dirname static to work with nss_db (bug #703567)