summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2009-07-14 16:45:07 -0400
committerSteve Dickson <steved@redhat.com>2009-07-14 16:45:07 -0400
commit23c1a452afce5726cfe661a4d7ac14a1883ecb55 (patch)
tree2a82686f508630e17a8e36cd3e4cacfd4fcaf08a /utils
parent134ea8cb64885fb587d038f80a1924f4c26470b9 (diff)
downloadnfs-utils-23c1a452afce5726cfe661a4d7ac14a1883ecb55.tar.gz
nfs-utils-23c1a452afce5726cfe661a4d7ac14a1883ecb55.tar.xz
nfs-utils-23c1a452afce5726cfe661a4d7ac14a1883ecb55.zip
mount.nfs: Don't update extra_opts after text-based negotiation
The umount.nfs command will negotiate the mount options again, so all that is needed in /etc/mnttab is the original set of options used for the mount, plus the additional mandatory options like addr=''. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils')
-rw-r--r--utils/mount/stropts.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
index e94265a..8d168db 100644
--- a/utils/mount/stropts.c
+++ b/utils/mount/stropts.c
@@ -283,7 +283,16 @@ static int nfs_validate_options(struct nfsmount_info *mi)
if (!nfs_append_sloppy_option(mi->options))
return 0;
- return nfs_append_addr_option(sap, salen, mi->options);
+ if (!nfs_append_addr_option(sap, salen, mi->options))
+ return 0;
+
+ /*
+ * Update option string to be recorded in /etc/mnttab
+ */
+ if (po_join(mi->options, mi->extra_opts) == PO_FAILED)
+ return 0;
+
+ return 1;
}
/*
@@ -476,7 +485,7 @@ out:
*/
static int nfs_try_mount(struct nfsmount_info *mi)
{
- char **extra_opts = mi->extra_opts;
+ char *options = NULL;
int result;
if (strncmp(mi->type, "nfs4", 4) != 0) {
@@ -484,20 +493,20 @@ static int nfs_try_mount(struct nfsmount_info *mi)
return 0;
}
- if (po_join(mi->options, extra_opts) == PO_FAILED) {
+ if (po_join(mi->options, &options) == PO_FAILED) {
errno = EIO;
return 0;
}
if (verbose)
printf(_("%s: trying text-based options '%s'\n"),
- progname, *extra_opts);
+ progname, options);
if (mi->fake)
return 1;
result = mount(mi->spec, mi->node, mi->type,
- mi->flags & ~(MS_USER|MS_USERS), *extra_opts);
+ mi->flags & ~(MS_USER|MS_USERS), options);
if (verbose && result) {
int save = errno;
nfs_error(_("%s: mount(2): %s"), progname, strerror(save));