summaryrefslogtreecommitdiffstats
path: root/utils/mount/nfsmount.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2007-07-16 16:28:51 -0400
committerNeil Brown <neilb@suse.de>2007-07-20 16:10:53 +1000
commit66ab98cbd17f7f54edda78a470579d3ab01f35c0 (patch)
tree9fa79dbd562a1abdb6aa7381a8339e31c47132ae /utils/mount/nfsmount.c
parent0dfc8a5426381c6d65aed4d9d0e50bae3238cc8f (diff)
downloadnfs-utils-66ab98cbd17f7f54edda78a470579d3ab01f35c0.tar.gz
nfs-utils-66ab98cbd17f7f54edda78a470579d3ab01f35c0.tar.xz
nfs-utils-66ab98cbd17f7f54edda78a470579d3ab01f35c0.zip
mount.nfs: Move start_statd into nfs_mount
Move start_startd into network.c, and move the call inside of nfs_mount, instead of immediately after - conceptually a better place for it. Also fix a minor nit: Since the mount actually fails if start_statd doesn't work, cause mount.nfs to exit with a status of EX_FAIL. Still need to do something about "running_bg" in nfsmount.c:nfsmount(). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'utils/mount/nfsmount.c')
-rw-r--r--utils/mount/nfsmount.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/utils/mount/nfsmount.c b/utils/mount/nfsmount.c
index 9c08ff5..a3cbbbe 100644
--- a/utils/mount/nfsmount.c
+++ b/utils/mount/nfsmount.c
@@ -89,6 +89,7 @@ typedef union {
} mntres_t;
extern int nfs_mount_data_version;
+extern char *progname;
extern int verbose;
extern int sloppy;
@@ -487,7 +488,7 @@ out_bad:
int
nfsmount(const char *spec, const char *node, int *flags,
char **extra_opts, char **mount_opts,
- int running_bg, int *need_statd)
+ int running_bg, int fake)
{
static char *prev_bg_host;
char hostdir[1024];
@@ -849,7 +850,18 @@ noauth_flavors:
strcat(new_opts, cbuf);
*extra_opts = xstrdup(new_opts);
- *need_statd = ! (data.flags & NFS_MOUNT_NONLM);
+
+ if (!fake && !(data.flags & NFS_MOUNT_NONLM)) {
+ if (!start_statd()) {
+ nfs_error(_("%s: rpc.statd is not running but is "
+ "required for remote locking.\n"
+ " Either use '-o nolocks' to keep "
+ "locks local, or start statd."),
+ progname);
+ goto fail;
+ }
+ }
+
return 0;
/* abort */