From: Chuck Lever <chuck.lever@oracle.com>
To: steved@redhat.com
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH 2/7] text-based mount command: Make "internal error" message more explicit
Date: Mon, 30 Jun 2008 13:10:18 -0400 [thread overview]
Message-ID: <20080630171017.9905.15113.stgit@ellison.1015granger.net> (raw)
In-Reply-To: <20080630170420.9905.90111.stgit-ewv44WTpT0t9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
The text-based mount command displays the rather inexplicable "mount:
internal error" whenever it encounters a problem that is entirely
unexpected by its designers.
Let's beef that error message up to include instructions about reporting
the problem, and fix the error code returned by the mount option rewriting
logic so that also will no longer report "internal error". An error in there
should generally only occur if there was an invalid mount option specified.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
utils/mount/error.c | 7 ++++++-
utils/mount/stropts.c | 7 ++++---
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/utils/mount/error.c b/utils/mount/error.c
index 147e919..5fd5705 100644
--- a/utils/mount/error.c
+++ b/utils/mount/error.c
@@ -231,8 +231,13 @@ void mount_error(const char *spec, const char *mount_point, int error)
rpc_mount_errors((char *)spec, 0, 0);
break;
case EIO:
+ nfs_error(_("%s: mount system call failed"), progname);
+ break;
case EFAULT:
- nfs_error(_("%s: internal error"), progname);
+ nfs_error(_("%s: encountered unexpected error condition."),
+ progname);
+ nfs_error(_("%s: please report the error to" PACKAGE_BUGREPORT),
+ progname);
break;
default:
nfs_error(_("%s: %s"),
diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
index 967fd69..c8148c4 100644
--- a/utils/mount/stropts.c
+++ b/utils/mount/stropts.c
@@ -356,12 +356,13 @@ static struct mount_options *rewrite_mount_options(char *str)
clnt_addr_t nfs_server = { };
int p;
- errno = EIO;
-
options = po_split(str);
- if (!options)
+ if (!options) {
+ errno = EFAULT;
return NULL;
+ }
+ errno = EINVAL;
option = po_get(options, "addr");
if (option) {
nfs_server.saddr.sin_family = AF_INET;
next prev parent reply other threads:[~2008-06-30 17:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-30 17:10 [PATCH 0/7] Patches for nfs-utils-1.1.3 Chuck Lever
[not found] ` <20080630170420.9905.90111.stgit-ewv44WTpT0t9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
2008-06-30 17:10 ` [PATCH 1/7] Python scripts: Report bandwidth in "kB/s" instead of "Kb/s" Chuck Lever
2008-06-30 17:10 ` Chuck Lever [this message]
2008-06-30 17:10 ` [PATCH 3/7] mount command: don't include headers multiple times Chuck Lever
2008-06-30 17:10 ` [PATCH 4/7] nfs-utils: Add dependency for getaddrinfo(3) in configure.ac Chuck Lever
2008-06-30 17:10 ` [PATCH 5/7] mount: Introduce IPv6-aware DNS resolver API function Chuck Lever
2008-06-30 17:10 ` [PATCH 6/7] mount command: move function to get kernel version to separate header Chuck Lever
2008-06-30 17:10 ` [PATCH 7/7] text-based mount command: pass "sloppy" when -s is set Chuck Lever
2008-07-15 19:30 ` [PATCH 0/7] Patches for nfs-utils-1.1.3 Steve Dickson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080630171017.9905.15113.stgit@ellison.1015granger.net \
--to=chuck.lever@oracle.com \
--cc=linux-nfs@vger.kernel.org \
--cc=steved@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox