diff options
Diffstat (limited to 'sbin/mount_nfs/mount_nfs.c')
-rw-r--r-- | sbin/mount_nfs/mount_nfs.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/sbin/mount_nfs/mount_nfs.c b/sbin/mount_nfs/mount_nfs.c index 6ea861193df8..e4c469eff0ae 100644 --- a/sbin/mount_nfs/mount_nfs.c +++ b/sbin/mount_nfs/mount_nfs.c @@ -32,20 +32,6 @@ * SUCH DAMAGE. */ -#if 0 -#ifndef lint -static const char copyright[] = -"@(#) Copyright (c) 1992, 1993, 1994\n\ - The Regents of the University of California. All rights reserved.\n"; -#endif /* not lint */ - -#ifndef lint -static char sccsid[] = "@(#)mount_nfs.c 8.11 (Berkeley) 5/4/95"; -#endif /* not lint */ -#endif -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - #include <sys/param.h> #include <sys/linker.h> #include <sys/module.h> @@ -73,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include <errno.h> #include <fcntl.h> #include <netdb.h> +#include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -160,7 +147,9 @@ main(int argc, char *argv[]) char mntpath[MAXPATHLEN], errmsg[255]; char hostname[MAXHOSTNAMELEN + 1], gssn[MAXHOSTNAMELEN + 50]; const char *gssname, *nmount_errstr; + bool softintr; + softintr = false; iov = NULL; iovlen = 0; memset(errmsg, 0, sizeof(errmsg)); @@ -210,6 +199,7 @@ main(int argc, char *argv[]) case 'i': printf("-i deprecated, use -o intr\n"); build_iovec(&iov, &iovlen, "intr", NULL, 0); + softintr = true; break; case 'L': printf("-L deprecated, use -o nolockd\n"); @@ -366,6 +356,10 @@ main(int argc, char *argv[]) "value -- %s", val); } pass_flag_to_nmount=0; + } else if (strcmp(opt, "soft") == 0) { + softintr = true; + } else if (strcmp(opt, "intr") == 0) { + softintr = true; } if (pass_flag_to_nmount) { build_iovec(&iov, &iovlen, opt, @@ -395,6 +389,7 @@ main(int argc, char *argv[]) case 's': printf("-s deprecated, use -o soft\n"); build_iovec(&iov, &iovlen, "soft", NULL, 0); + softintr = true; break; case 'T': nfsproto = IPPROTO_TCP; @@ -433,6 +428,11 @@ main(int argc, char *argv[]) /* NOTREACHED */ } + /* Warn that NFSv4 mounts only work correctly as hard mounts. */ + if (mountmode == V4 && softintr) + warnx("Warning, options soft and/or intr cannot be safely used" + " for NFSv4. See the BUGS section of mount_nfs(8)"); + spec = *argv++; mntname = *argv; |