Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Nov 1997 12:50:32 +0100
From:      j@uriah.heep.sax.de (J Wunsch)
To:        current@FreeBSD.ORG (current@freebsd.org)
Cc:        mburgett@awen.com (Mike Burgett)
Subject:   Re: nfs mounting the same partition over and over...
Message-ID:  <19971123125032.KQ60079@uriah.heep.sax.de>
In-Reply-To: <199711222253.OAA00371@dragon.awen.com>; from Mike Burgett on Nov 22, 1997 14:53:34 -0800
References:  <199711222253.OAA00371@dragon.awen.com>

next in thread | previous in thread | raw e-mail | index | archive | help
As Mike Burgett wrote:

> The below patch is intended to prevent being able to remount nfs partitions 
> over and over (and having to umount them over and over to really get rid of 
> them...)

It is completely broken, sorry.

I don't pretend to have much understanding of filesystem code myself,
but you OTOH didn't even bother to read and compare the code you were
hacking on.  Otherwise, you should have noticed that the ndp's in
ffs_mountfs() and nfs_mount() are two *very different* ndp's.  You are
applying your check to the mountpoint directory.  The FFS code doesn't
do this (this would be the ndp in ffs_mount()), it applies the check
to the source device (disk partition), which is legitime.

Again, since you didn't respond to the followups Bruce and me have
sent to your PR: it is _intention_ that you can mount multiple times
over the same mountpoint.  (FFS needs to restrict this so you can
mount the same resource only once, but even with FFS, it's still
possible to mount two different partitions stacked over the same
mountpoint.  Other filesystems like NFS have no need to restrict a
re-use of the same resource.)

The original bug you're trying to fix here was that mount -a did
attempt to mount the same filesystems over and over again.  This
was broken from the beginning, and only incidentally halfways worked
all the time since FFS cannot mount a resource more than once.  Not
only NFS was affected by the breakage, but other filesystems as well.
Suppose you've got a MFS /tmp in your fstab, repeatedly calling
`mount -a' would start a new MFS process each time.

As indicated in the followups to your PR (which i'm going to close),
Steve Price fixed the mount -a bug on 1997/08/24 (and unlike your
hack, we did quite some tests before allowing the fix to go in,
including running it on a diskless machine, and on a MFS /tmp
machine).  However, Steve and i considered the change in behaviour of
mount -a too drastical to merge it into the 2.2-stable branch.


Sorry to sound that harsh here, but it's sometimes not a bad idea to
discuss matters first...

-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)



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