* [PATCH 1/1] mount.nfs: mounts fail when invalid versions are specified
@ 2011-09-15 14:36 Steve Dickson
0 siblings, 0 replies; only message in thread
From: Steve Dickson @ 2011-09-15 14:36 UTC (permalink / raw)
To: Linux NFS Mailing list
When mount options like -o nfsvers=5 or -o v5 call the mount
to silently fail. This patch adds verbosity to those types
of failures.
Signed-off-by: Steve Dickson <steved@redhat.com>
---
utils/mount/network.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/utils/mount/network.c b/utils/mount/network.c
index e7bd522..e125c11 100644
--- a/utils/mount/network.c
+++ b/utils/mount/network.c
@@ -1235,6 +1235,10 @@ nfs_nfs_version(struct mount_options *options, unsigned long *version)
long tmp;
switch (po_rightmost(options, nfs_version_opttbl)) {
+ case -1: /* invalid value */
+ nfs_error(_("%s: invalid mount option was specified"),
+ progname);
+ return 0;
case 0: /* v2 */
*version = 2;
return 1;
@@ -1251,6 +1255,8 @@ nfs_nfs_version(struct mount_options *options, unsigned long *version)
*version = tmp;
return 1;
}
+ nfs_error(_("%s: invalid value for 'vers=' option"),
+ progname);
return 0;
case PO_NOT_FOUND:
nfs_error(_("%s: parsing error on 'vers=' option\n"),
@@ -1268,6 +1274,8 @@ nfs_nfs_version(struct mount_options *options, unsigned long *version)
*version = tmp;
return 1;
}
+ nfs_error(_("%s: invalid value for 'nfsvers=' option"),
+ progname);
return 0;
case PO_NOT_FOUND:
nfs_error(_("%s: parsing error on 'nfsvers=' option\n"),
--
1.7.6
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-09-15 14:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-15 14:36 [PATCH 1/1] mount.nfs: mounts fail when invalid versions are specified Steve Dickson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).