From owner-freebsd-current@FreeBSD.ORG Sun Oct 26 22:42:31 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 31D2B377 for ; Sun, 26 Oct 2014 22:42:31 +0000 (UTC) Received: from esa-annu.net.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id EC73EFE8 for ; Sun, 26 Oct 2014 22:42:30 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aq0EAJR3TVSDaFve/2dsb2JhbABcg2JYBIMCyWsKhnlUAoEgAX2EAwEBBAEBASArIAYFBRYOCgICDRkCKQEJJgYIBwQBHASIIA2zbJN4AQEBAQEFAQEBAQEBARuBLI8LAQEbNAeCd4FUBZZPhA6ENTyQQYQAhBQhLweBCDmBAwEBAQ X-IronPort-AV: E=Sophos;i="5.04,792,1406606400"; d="scan'208";a="163624052" Received: from muskoka.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.222]) by esa-annu.net.uoguelph.ca with ESMTP; 26 Oct 2014 18:42:29 -0400 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id 69563B416D; Sun, 26 Oct 2014 18:42:29 -0400 (EDT) Date: Sun, 26 Oct 2014 18:42:29 -0400 (EDT) From: Rick Macklem To: Konstantin Belousov Message-ID: <234024408.7891655.1414363349422.JavaMail.root@uoguelph.ca> In-Reply-To: <20141026124109.GR1877@kib.kiev.ua> Subject: Re: Some NFS server V4 questions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.91.209] X-Mailer: Zimbra 7.2.6_GA_2926 (ZimbraWebClient - FF3.0 (Win)/7.2.6_GA_2926) Cc: freebsd-current@freebsd.org, Beeblebrox X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 22:42:31 -0000 Kostik wrote: > On Sun, Oct 26, 2014 at 08:14:05AM -0400, Rick Macklem wrote: > > Beeblebrox wrote: > > > Sorry guys, we have a considerable time-zone difference. > > > > > > >> It appears that the sysctl must be set before mountd, nfsd are > > > >> started to take effect. (Or they must be restarted after it is > > > >> set.) > > > I had apparently re-started nfsd but not mountd. This time > > > re-starting both and launching the PXE client fails at mount_root > > > stage as expected: > > > exec /sbin/init: error 43 > > > exec /rescue/init: error 43 > > > panic: no init > > > > > > One cannot set "sysctl vfs.nfsd.server_min_nfsvers=4" until one > > > of > > > mountd/nfsd is started however, otherwise it gives an error. I > > > have > > > not tried, but I suppose this error does not happen when placeed > > > in > > > /etc/sysctl.conf? > > > sysctl: unknown oid 'vfs.nfsd.server_min_nfsvers': No such file > > > or > > > directory > > > > > It works if it is /etc/sysctl.conf if "options NFSD" are specified > > for the kernel, which is what GENERIC for i386 has. > > > > If "options NFSD" isn't in your kernel config, I think you'd have > > to > > get nfsd.ko loaded before setting the sysctl and do both before > > starting mountd. > > > > I don't know of a clean way to do this? > > > > Putting kldload and sysctl command lines in mountd_precmd() in > > /etc/rc.d/mountd would do it I suspect. Maybe rc variables for > > this should be added? (I haven't tried this since the only > > kernels I have handy have "options NFSD" in them.) > > With the following patch, the same variables should work when > set from the loader.conf (i.e. pre-boot) or using kenv(8). > > diff --git a/sys/fs/nfsserver/nfs_nfsdkrpc.c > b/sys/fs/nfsserver/nfs_nfsdkrpc.c > index d2145cc..4fb9c93 100644 > --- a/sys/fs/nfsserver/nfs_nfsdkrpc.c > +++ b/sys/fs/nfsserver/nfs_nfsdkrpc.c > @@ -85,16 +85,16 @@ SYSCTL_DECL(_vfs_nfsd); > SVCPOOL *nfsrvd_pool; > > static int nfs_privport = 0; > -SYSCTL_INT(_vfs_nfsd, OID_AUTO, nfs_privport, CTLFLAG_RW, > +SYSCTL_INT(_vfs_nfsd, OID_AUTO, nfs_privport, CTLFLAG_RWTUN, > &nfs_privport, 0, > "Only allow clients using a privileged port for NFSv2 and 3"); > > static int nfs_minvers = NFS_VER2; > -SYSCTL_INT(_vfs_nfsd, OID_AUTO, server_min_nfsvers, CTLFLAG_RW, > +SYSCTL_INT(_vfs_nfsd, OID_AUTO, server_min_nfsvers, CTLFLAG_RWTUN, > &nfs_minvers, 0, "The lowest version of NFS handled by the > server"); > > static int nfs_maxvers = NFS_VER4; > -SYSCTL_INT(_vfs_nfsd, OID_AUTO, server_max_nfsvers, CTLFLAG_RW, > +SYSCTL_INT(_vfs_nfsd, OID_AUTO, server_max_nfsvers, CTLFLAG_RWTUN, > &nfs_maxvers, 0, "The highest version of NFS handled by the > server"); > > static int nfs_proc(struct nfsrv_descript *, u_int32_t, SVCXPRT > *xprt, Worked fine for me. Do you mind if I commit this or would you rather do it. Thanks, rick > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to > "freebsd-current-unsubscribe@freebsd.org" >