Bug 13161

Summary: mounting on top of a mounted file system
Product: Base System Reporter: Randall Hopper <aa8vb>
Component: kernAssignee: Alfred Perlstein <alfred>
Status: Closed FIXED    
Severity: Affects Only Me CC: aa8vb
Priority: Normal    
Version: 3.2-RELEASE   
Hardware: Any   
OS: Any   

Description Randall Hopper 1999-08-15 20:20:00 UTC
I had:

   > df | grep 32_share
   /dev/wd1s3e   2031953  1353017   516380    72%    /32_share

Then I mistakenly did a:

   > mount /dev/wd0s3e /32_share
                  ^

And it didn't generate an error (!?).  I then had:

   > df | grep 32_share
   /dev/wd1s3e   2031953  1353017   516380    72%    /32_share
   /dev/wd0s3e   2032623  1169007   701007    63%    /32_share

Odd things started happening (vi failed, missing directories, etc.), so I
rebooted.  All is normal now, and nothing lost AFAIK, but that sure was
strange.

This looks like a bug.

Fix: 

Unknown.  I think that mount should issue an error when this is attempted.
How-To-Repeat: 
   > mount /dev/wd1s1  /abc
   > mount /dev/wd1s2  /abc
 
   In this case, both were FreeBSD UFSs.
Comment 1 bill fumerola freebsd_committer freebsd_triage 1999-08-15 21:32:16 UTC
Responsible Changed
From-To: freebsd-bugs->billf

I have a number of patches from Martin Blapp <blapp@attic.ch> 
one of which addresses this problem. 

Comment 2 Garrett A. Wollman 1999-08-16 01:01:35 UTC
<<On Sun, 15 Aug 1999 13:34:01 -0700 (PDT), <billf@FreeBSD.ORG> said:

> I have a number of patches from Martin Blapp <blapp@attic.ch>
> one of which addresses this problem.

I disagree that it's a problem.  Unexpected to users of other
operating systems, yes, but I'd still consider it a feature (and the
behavior of those other systems a bug).  AIX has similar flexible
mount semantics (in fact, more so -- AIX can mount files as well as
directories).

-GAWollman
Comment 3 mblapp 1999-08-29 17:05:27 UTC
Solaris 7 does know the option '-O' to allow overlay mounts.

I've patched mount and all mount_xxx to recognize and controll
overlay mounts. With my fix, mounting on top will be still possible.
It's the best for both sides, I think. We don't loose functionality,
and it is more userfriendly.

The other thing is, if we allow overlay mounts, umount should know
to handle them properly. I've patched umount too, to always unmount
overlay mounts in right order.

Martin
Comment 4 bill fumerola freebsd_committer freebsd_triage 1999-09-05 00:53:04 UTC
Responsible Changed
From-To: billf->alfred

Alfred has been working with Martin Blapp who has patches 
to address this. 
Comment 5 Alfred Perlstein freebsd_committer freebsd_triage 2002-04-13 12:27:01 UTC
State Changed
From-To: open->closed

Martin says that the "overlay" mount stuff fixes this.