Date: Fri, 25 Dec 1998 11:00:29 +0000 (GMT) From: Doug Rabson <dfr@nlsystems.com> To: Matthew Patton <patton@sysnet.net> Cc: freebsd-questions@FreeBSD.ORG Subject: Re: NFS loopback mounts Message-ID: <Pine.BSF.4.01.9812251052240.5967-100000@herring.nlsystems.com> In-Reply-To: <l0311070cb2a8c196440e@[192.168.1.10]>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 25 Dec 1998, Matthew Patton wrote: > I didn't see a forum on NFS specifics, so here goes. > > Apparently doing something like this is not a good idea under heavy NFS IO > with big files. > > [fstab] > >/dev/da0s1e /export/1 ufs rw 3 2 > >/dev/da0s1f /export/2 ufs rw 3 2 > >/dev/da1s1a /export/3 ufs rw 2 2 > > >localhost:/export/1/FreeBSD /usr nfs rw 0 0 > >localhost:/export/2/FreeBSD/src /usr/src nfs rw 0 0 > >localhost:/export/3/FreeBSD/ports /usr/ports nfs rw 0 0 > >localhost:/export/3/home /home nfs rw 0 0 > > [exports] > >/export/1 -alldirs -maproot=root > >/export/2 -alldirs > >/export/3 -alldirs > > I was doing a 'make update' (cvsup) on /usr/src and NFS consistantly went > out to lnuch on fortunes.dat (first file of notable size). Whatever it did, > it took out all NFS exporting which led to hung machines on my little > network. > > Doing a 'make update' on another box, which NFS mounts practically > everything off the server (s/localhost/nfsserver) works wonderfully. > > So are loopback mounts dangerous? Did I hit some sort of race condition by > double mounting? My idea was that I could sit down on any of my hosts and > expect to see the same FS layout. This also necessitated some /etc/rc edits > to start nfsd VERY early in the process and a staticly compiled portmap > installed in /sbin, etc. I'm beginning to think this was a bad move > afterall and that I should just dedicate the box to NFS and not play fancy > games with mount points. I have never managed to get loopback mounts to work reliably with NFSv3. I believe that there is a deadlock connected with the vnode locks (which doesn't appear on NFSv2 since writes are performed synchronously). When I mentioned this to the author (a few years ago), he agreed. Loopback mounts have serious security problems and should be discouraged except for testing. > > > Now onto a mountd question. I've noticed the different behavior exhibited > by the 3 more popular free unix's. If no host is specified in /etc/exports, > OpenBSD tosses the line, FreeBSD defaults to everyone (with whatever > options provided), and Linux uses everyone but explicitely changes the > mount type to be anonymous (nosuid, nodev etc). I think the Linux guys for > once came up with the best solution. Is there any interest in folding in > the Linux everyone=anonymous behavior? > > Linux also lets you specify a raft of options on the server side such that > I don't have to specify (ro,nosuid,nodev) on each and every client. The > Free/OpenBSD syntax seems rather backward/limiting by comparison. > > Likewise Free/OpenBSD lack the ability to export filesystems except at > their mount points. Right now I have to export all of /export/2 (above) > with the -alldirs flag instead of something like /export/2/FreeBSD -options. Yes. In *BSD, the export information is held in the kernel at the mount point. > > Again, is there any interest in adding such functionality? Please don't > take this as a knock against the *BSD family. I'm a HUGE proponent of the > platform and run exactly 1 Linux box out of the dozen or more hosts under > my control. > > If there is sufficient interest (or maybe even if not) I intend to generate > appropriate diffs at some later point in time. I think that supporting export locations not at a mount point would be hard. The filehandle currently only specifies which mount point is being referenced so a client could easily fake a filehandle for files outside the mounted tree and it would be hard to detect. A totally different scheme for generating filehandles would probably be needed. -- 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-questions" 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.01.9812251052240.5967-100000>