diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2010-02-12 13:36:17 -0500 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2010-02-12 13:41:48 -0500 |
commit | 0f76458dd0f9a34210e44515a67d55e713a990ce (patch) | |
tree | 87f09d9ee10a4a4bc5e07242522ef236a91a222a /utils | |
parent | 25dd860f13b93109dfd54ef8be0bfd91e4353af1 (diff) | |
download | nfs-utils-0f76458dd0f9a34210e44515a67d55e713a990ce.tar.gz nfs-utils-0f76458dd0f9a34210e44515a67d55e713a990ce.tar.xz nfs-utils-0f76458dd0f9a34210e44515a67d55e713a990ce.zip |
text-based mount: Set addr= option in nfs_try_mount_foo()
When retrying a mount request with a different server address, the
addr= option may change each time through the fg/bg loop.
Instead of setting the addr= option in nfs_validate_options(), set it
in nfs_try_mount_v2v3() and nfs_try_mount_v4(). This is much the
same thing we did recently with the version-specific mount options
which might change each time through the fg/bg retry loop.
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.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c index 4ffee48..fc1b0da 100644 --- a/utils/mount/stropts.c +++ b/utils/mount/stropts.c @@ -563,10 +563,6 @@ static int nfs_sys_mount(struct nfsmount_info *mi, struct mount_options *opts) return 0; } - if (verbose) - printf(_("%s: trying text-based options '%s'\n"), - progname, options); - if (mi->fake) return 1; @@ -585,6 +581,7 @@ static int nfs_sys_mount(struct nfsmount_info *mi, struct mount_options *opts) */ static int nfs_try_mount_v3v2(struct nfsmount_info *mi) { + struct addrinfo *ai = mi->address; struct mount_options *options = po_dup(mi->options); int result = 0; @@ -593,6 +590,11 @@ static int nfs_try_mount_v3v2(struct nfsmount_info *mi) return result; } + if (!nfs_append_addr_option(ai->ai_addr, ai->ai_addrlen, options)) { + errno = EINVAL; + goto out_fail; + } + if (!nfs_fix_mounthost_option(options, mi->hostname)) { errno = EINVAL; goto out_fail; @@ -613,6 +615,10 @@ static int nfs_try_mount_v3v2(struct nfsmount_info *mi) goto out_fail; } + if (verbose) + printf(_("%s: trying text-based options '%s'\n"), + progname, *mi->extra_opts); + if (!nfs_rewrite_pmap_mount_options(options)) goto out_fail; @@ -656,6 +662,11 @@ static int nfs_try_mount_v4(struct nfsmount_info *mi) } } + if (!nfs_append_addr_option(ai->ai_addr, ai->ai_addrlen, options)) { + errno = EINVAL; + goto out_fail; + } + if (!nfs_append_clientaddr_option(ai->ai_addr, ai->ai_addrlen, options)) { errno = EINVAL; goto out_fail; @@ -669,6 +680,10 @@ static int nfs_try_mount_v4(struct nfsmount_info *mi) goto out_fail; } + if (verbose) + printf(_("%s: trying text-based options '%s'\n"), + progname, *mi->extra_opts); + result = nfs_sys_mount(mi, options); out_fail: |