summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorHarshula Jayasuriya <harshula@redhat.com>2009-11-16 13:42:08 -0500
committerSteve Dickson <steved@redhat.com>2009-11-16 13:42:08 -0500
commit29e2293a69a75abf0ce1c85daff0b94c9875d56a (patch)
treedb692d175a4fa706ec0dc07ff62cb41858a699a2 /utils
parent1cf5510adf8cbf7c342d8fce73f0b62ac1f93612 (diff)
downloadnfs-utils-29e2293a69a75abf0ce1c85daff0b94c9875d56a.tar.gz
nfs-utils-29e2293a69a75abf0ce1c85daff0b94c9875d56a.tar.xz
nfs-utils-29e2293a69a75abf0ce1c85daff0b94c9875d56a.zip
nfs-utils: NFSv4: fix backgrounding
he nfsmount() function checks if !bg before running switch(rpc_createerr.cf_stat). On the other hand, the nfs4mount() function does not, and results in exiting the loop on the first iteration even with the bg mount option. NOTE: This and the previous patch ("nfs-utils: mount options can be lost when using bg option") are relevant to non text-based mount options. See https://bugzilla.redhat.com/show_bug.cgi?id=529370 for details. Signed-off-by: Harshula Jayasuriya <harshula@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils')
-rw-r--r--utils/mount/nfs4mount.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/utils/mount/nfs4mount.c b/utils/mount/nfs4mount.c
index a2f318f..4a2fab7 100644
--- a/utils/mount/nfs4mount.c
+++ b/utils/mount/nfs4mount.c
@@ -217,8 +217,11 @@ int nfs4mount(const char *spec, const char *node, int flags,
progname);
goto fail;
}
- snprintf(new_opts, sizeof(new_opts), "%s%saddr=%s",
- old_opts, *old_opts ? "," : "", s);
+ if (running_bg)
+ strncpy(new_opts, old_opts, sizeof(new_opts));
+ else
+ snprintf(new_opts, sizeof(new_opts), "%s%saddr=%s",
+ old_opts, *old_opts ? "," : "", s);
*extra_opts = xstrdup(new_opts);
/* Set default options.
@@ -434,15 +437,17 @@ int nfs4mount(const char *spec, const char *node, int flags,
break;
}
- switch(rpc_createerr.cf_stat){
- case RPC_TIMEDOUT:
- break;
- case RPC_SYSTEMERROR:
- if (errno == ETIMEDOUT)
+ if (!bg) {
+ switch(rpc_createerr.cf_stat) {
+ case RPC_TIMEDOUT:
break;
- default:
- rpc_mount_errors(hostname, 0, bg);
- goto fail;
+ case RPC_SYSTEMERROR:
+ if (errno == ETIMEDOUT)
+ break;
+ default:
+ rpc_mount_errors(hostname, 0, bg);
+ goto fail;
+ }
}
if (bg && !running_bg) {