From: Chuck Lever <chuck.lever@oracle.com>
To: steved@redhat.com
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH 7/7] text-based mount command: pass "sloppy" when -s is set
Date: Mon, 30 Jun 2008 13:10:47 -0400 [thread overview]
Message-ID: <20080630171046.9905.32473.stgit@ellison.1015granger.net> (raw)
In-Reply-To: <20080630170420.9905.90111.stgit-ewv44WTpT0t9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
Currently the "-s" option is ignored by the text-based mount interface. To
notify the kernel that sloppy mount option parsing is needed, add "sloppy"
to the string of mount options passed to the kernel.
The 2.6.23 - 2.6.26 kernels will fail the mount if "sloppy" is present, as
they won't recognize it. To prevent them from ever seeing this option,
have the mount command check the kernel version before appending the option.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
utils/mount/stropts.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
index c8148c4..34b4134 100644
--- a/utils/mount/stropts.c
+++ b/utils/mount/stropts.c
@@ -45,6 +45,7 @@
#include "error.h"
#include "network.h"
#include "parse_opt.h"
+#include "version.h"
#ifdef HAVE_RPCSVC_NFS_PROT_H
#include <rpcsvc/nfs_prot.h>
@@ -76,6 +77,7 @@
extern int nfs_mount_data_version;
extern char *progname;
extern int verbose;
+extern int sloppy;
struct nfsmount_info {
const char *spec, /* server:/path */
@@ -287,6 +289,16 @@ static int verify_lock_option(struct mount_options *options)
return 1;
}
+static int nfs_append_sloppy_option(struct mount_options *options)
+{
+ if (!sloppy || linux_version_code() < MAKE_VERSION(2, 6, 27))
+ return 1;
+
+ if (po_append(options, "sloppy") == PO_FAILED)
+ return 0;
+ return 1;
+}
+
/*
* Set up mandatory NFS mount options.
*
@@ -309,6 +321,9 @@ static int nfs_validate_options(struct nfsmount_info *mi)
return 0;
}
+ if (!nfs_append_sloppy_option(mi->options))
+ return 0;
+
if (!append_addr_option(&saddr, mi->options))
return 0;
next prev parent reply other threads:[~2008-06-30 17:11 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 ` [PATCH 2/7] text-based mount command: Make "internal error" message more explicit Chuck Lever
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 ` Chuck Lever [this message]
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=20080630171046.9905.32473.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