Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Apr 2011 00:06:56 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r220980 - in head: . usr.sbin/mountd usr.sbin/nfsd
Message-ID:  <201104240006.p3O06uBT009037@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Sun Apr 24 00:06:56 2011
New Revision: 220980
URL: http://svn.freebsd.org/changeset/base/220980

Log:
  This patch changes the default NFS server to the new one, which was
  referred to as the experimental server. It also adds a new command
  line option "-o" to both mountd and nfsd that forces them to use the
  old/regular NFS server. The "-e" option for these commands is now
  a no-op, since the new server is the default. I will be committing rc
  script and man changes soon. Discussed on freebsd-fs@.

Modified:
  head/UPDATING
  head/usr.sbin/mountd/mountd.c
  head/usr.sbin/nfsd/nfsd.c

Modified: head/UPDATING
==============================================================================
--- head/UPDATING	Sat Apr 23 23:11:44 2011	(r220979)
+++ head/UPDATING	Sun Apr 24 00:06:56 2011	(r220980)
@@ -22,6 +22,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.
 	machines to maximize performance.  (To disable malloc debugging, run
 	ln -s aj /etc/malloc.conf.)
 
+20110423:
+	The default NFS server has been changed to the new server, which
+	was referred to as the experimental server. If you need to switch
+	back to the old NFS server, you must now put the "-o" option on
+	both the mountd and nfsd commands. This can be done using the
+	mountd_flags and nfs_server_flags rc.conf variables until an
+	update to the rc scripts is committed, which is coming soon.
+
 20110418:
 	The GNU Objective-C runtime library (libobjc), and other Objective-C
 	related components have been removed from the base system.  If you

Modified: head/usr.sbin/mountd/mountd.c
==============================================================================
--- head/usr.sbin/mountd/mountd.c	Sat Apr 23 23:11:44 2011	(r220979)
+++ head/usr.sbin/mountd/mountd.c	Sun Apr 24 00:06:56 2011	(r220980)
@@ -239,7 +239,7 @@ static int have_v6 = 1;
 
 int v4root_phase = 0;
 char v4root_dirpath[PATH_MAX + 1];
-int run_v4server = 0;
+int run_v4server = 1;
 int has_publicfh = 0;
 
 struct pidfh *pfh = NULL;
@@ -296,13 +296,13 @@ main(int argc, char **argv)
 	else
 		close(s);
 
-	while ((c = getopt(argc, argv, "2deh:lnp:r")) != -1)
+	while ((c = getopt(argc, argv, "2deh:lnop:r")) != -1)
 		switch (c) {
 		case '2':
 			force_v2 = 1;
 			break;
 		case 'e':
-			run_v4server = 1;
+			/* now a no-op, since this is the default */
 			break;
 		case 'n':
 			resvport_only = 0;
@@ -316,6 +316,9 @@ main(int argc, char **argv)
 		case 'l':
 			dolog = 1;
 			break;
+		case 'o':
+			run_v4server = 0;
+			break;
 		case 'p':
 			endptr = NULL;
 			svcport = (in_port_t)strtoul(optarg, &endptr, 10);
@@ -350,9 +353,8 @@ main(int argc, char **argv)
 		};
 
 	/*
-	 * If the "-e" option was specified OR only the nfsd module is
-	 * found in the server, run "nfsd".
-	 * Otherwise, try and run "nfsserver".
+	 * Unless the "-o" option was specified, try and run "nfsd".
+	 * If "-o" was specified, try and run "nfsserver".
 	 */
 	if (run_v4server > 0) {
 		if (modfind("nfsd") < 0) {
@@ -360,8 +362,6 @@ main(int argc, char **argv)
 			if (kldload("nfsd") < 0 || modfind("nfsd") < 0)
 				errx(1, "NFS server is not available");
 		}
-	} else if (modfind("nfsserver") < 0 && modfind("nfsd") >= 0) {
-		run_v4server = 1;
 	} else if (modfind("nfsserver") < 0) {
 		/* Not present in kernel, try loading it */
 		if (kldload("nfsserver") < 0 || modfind("nfsserver") < 0)

Modified: head/usr.sbin/nfsd/nfsd.c
==============================================================================
--- head/usr.sbin/nfsd/nfsd.c	Sat Apr 23 23:11:44 2011	(r220979)
+++ head/usr.sbin/nfsd/nfsd.c	Sun Apr 24 00:06:56 2011	(r220980)
@@ -88,7 +88,7 @@ int	debug = 0;
 pid_t	children[MAXNFSDCNT];	/* PIDs of children */
 int	nfsdcnt;		/* number of children */
 int	new_syscall;
-int	run_v4server = 0;	/* Force running of nfsv4 server */
+int	run_v4server = 1;	/* Force running of nfsv4 server */
 int	nfssvc_nfsd;		/* Set to correct NFSSVC_xxx flag */
 int	stablefd = -1;		/* Fd for the stable restart file */
 int	backupfd;		/* Fd for the backup stable restart file */
@@ -152,8 +152,8 @@ main(int argc, char **argv)
 	nfsdcnt = DEFNFSDCNT;
 	unregister = reregister = tcpflag = maxsock = 0;
 	bindanyflag = udpflag = connect_type_cnt = bindhostc = 0;
-#define	GETOPT	"ah:n:rdtue"
-#define	USAGE	"[-ardtue] [-n num_servers] [-h bindip]"
+#define	GETOPT	"ah:n:rdtueo"
+#define	USAGE	"[-ardtueo] [-n num_servers] [-h bindip]"
 	while ((ch = getopt(argc, argv, GETOPT)) != -1)
 		switch (ch) {
 		case 'a':
@@ -189,7 +189,10 @@ main(int argc, char **argv)
 			udpflag = 1;
 			break;
 		case 'e':
-			run_v4server = 1;
+			/* now a no-op, since this is the default */
+			break;
+		case 'o':
+			run_v4server = 0;
 			break;
 		default:
 		case '?':
@@ -216,9 +219,8 @@ main(int argc, char **argv)
 	}
 
 	/*
-	 * If the "-e" option was specified OR only the nfsd module is
-	 * found in the server, run "nfsd".
-	 * Otherwise, try and run "nfsserver".
+	 * Unless the "-o" option was specified, try and run "nfsd".
+	 * If "-o" was specified, try and run "nfsserver".
 	 */
 	if (run_v4server > 0) {
 		if (modfind("nfsd") < 0) {
@@ -226,8 +228,6 @@ main(int argc, char **argv)
 			if (kldload("nfsd") < 0 || modfind("nfsd") < 0)
 				errx(1, "NFS server is not available");
 		}
-	} else if (modfind("nfsserver") < 0 && modfind("nfsd") >= 0) {
-		run_v4server = 1;
 	} else if (modfind("nfsserver") < 0) {
 		/* Not present in kernel, try loading it */
 		if (kldload("nfsserver") < 0 || modfind("nfsserver") < 0)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201104240006.p3O06uBT009037>