Date: Sun, 21 Feb 1999 11:54:09 +0000 (GMT) From: Doug Rabson <dfr@nlsystems.com> To: Bruce Evans <bde@zeta.org.au> Cc: current@FreeBSD.ORG, romanp@wuppy.rcs.ru, dfr@FreeBSD.ORG Subject: Re: Problems with nfsstat and dynamic OID Message-ID: <Pine.BSF.4.05.9902211152570.82049-100000@herring.nlsystems.com> In-Reply-To: <199902210358.OAA07200@godzilla.zeta.org.au>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 21 Feb 1999, Bruce Evans wrote: > >Hello! Five minutes ago I type 'nfsstat' and got: > > > >nfsstat: sysctl: No such file or directory > > > >I take a look at the source and that's what I found: > >Nfsstat gets statistic via sysctl(3). name[0]=CTL_VFS, name[2]=NFS_NFSSTATS, > >but name[1] has a value of vfc.vfc_typenum, returned by getvfsbyname(3). > >And it is very bad, 'cause vfc_typenum contains fs type number assigned > >by kernel, not sysctl OID! As we can see in nfs_vfsops.c NFS sysctl node > >declared with OID_AUTO (on my system it becomes 119, not 4 as returned by > >getvfsbyname). > > Now that it is possible to change the sysctl tree at runtime, the changes > are not actually (completely) made for vfs sysctls. Special code for > making "impossible" changes for vfs sysctls went away. A related problem is in mountd which should be fixed by this patch: Index: mountd.c =================================================================== RCS file: /home/ncvs/src/sbin/mountd/mountd.c,v retrieving revision 1.34 diff -u -r1.34 mountd.c --- mountd.c 1998/12/29 09:38:49 1.34 +++ mountd.c 1999/02/21 11:53:45 @@ -255,7 +255,7 @@ char **argv; { SVCXPRT *udptransp, *tcptransp; - int c, error, mib[3]; + int c, error; struct vfsconf vfc; error = getvfsbyname("nfs", &vfc); @@ -321,10 +321,7 @@ } } if (!resvport_only) { - mib[0] = CTL_VFS; - mib[1] = vfc.vfc_typenum; - mib[2] = NFS_NFSPRIVPORT; - if (sysctl(mib, 3, NULL, NULL, &resvport_only, + if (sysctlbyname("vfs.nfs.nfs_privport", NULL, NULL, &resvport_only, sizeof(resvport_only)) != 0 && errno != ENOENT) { syslog(LOG_ERR, "sysctl: %m"); exit(1); -- Doug Rabson Mail: dfr@nlsystems.com Nonlinear Systems Ltd. Phone: +44 181 442 9037 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.05.9902211152570.82049-100000>