Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Nov 97 06:54:30 -0800
From:      "Mike Burgett" <mburgett@awen.com>
To:        "current@freebsd.org" <current@freebsd.org>, "Joerg Wunsch" <joerg_wunsch@uriah.heep.sax.de>
Subject:   Re: nfs mounting the same partition over and over...
Message-ID:  <199711231454.GAA05747@dragon.awen.com>

next in thread | raw e-mail | index | archive | help
On Sun, 23 Nov 1997 12:50:32 +0100, J Wunsch wrote:

>It is completely broken, sorry.

That's what I wanted to find out.

>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.

I wasn't trying to pretend to understand anything.  It's confusing in there, 
and I suspected the patch/hack was incorrect/incomplete, which is why I posted 
it here, to get feedback.

I know the ffs is checking the ndp for the device, and I'm checking for the 
mountpoint.  I traced the code with printf's, noting the count went > 1 on 
subsequent mounts of a nfs system on the mountpoint, so it seemed reasonable 
to use the check. (actually, devices you attempt to mount more that once seem 
to get weeded out by a check just prior to the code I stole from ffs, when 
vfs_mountedon is called, but that relies on the the fact it's a special 
device, using the flag bits for such...)

>Again, since you didn't respond to the followups Bruce and me have
>sent to your PR:

I'm sorry.  I'm pretty good about responding to my email, but I've seen 
nothing from either of you about the pr...  I could have missed it in a crush 
of mail messages I suppose, but it would be unusual for me to miss multiple 
messages.  Or were the responses in question to some other mailing list I've 
missed?  I read questions, hackers, hardware, mobile, ports, scsi, stable, 
(and since yesterday) current.

> 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.)

I understand that, but it seem sloppy to allow the *same* nfs filesystem to be 
mounted over the same mountpoint multiple times too.  (And yes, I know my hack 
wouldn't differentiate...)

>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.

Mounting a nfs partition over and over by name succeeds too, not just when 
mount -a is done.

>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.

I didn't intend for my message (either to here, or -stable) to be taken as a 
request to submit the code to the repository, for _any_ version.  I just 
wanted people who know more about it than me (which, as you've pointed out, is 
just about anyone) to look at it, discuss it, and test it, if they were so 
inclined. Perhaps this was the wrong place to make such a request, and only 
code that's ready to submit should be posted here.  Sorry if that's the case.  

I thought I was clear that I didn't have the resources here to test do any but 
very simple tests.

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

Wow... I thought that's what I was doing, by posting my hack, and asking for 
tests/comments.  I see people bashed all the time too, for just complaining 
about broken code, and not trying to help fix it.  I was trying to avoid that 
syndrome. :-/

If you're interested in discussing it, either here, or offline, I'd be 
interested in more info than just 'it's completely broken'....

Thanks,
Mike







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