Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Feb 1999 13:36:03 +0000
From:      Tony Finch <dot@dotat.at>
To:        current@freebsd.org
Subject:   Re: mount -o union broken recently?
Message-ID:  <E10GNQx-0002lU-00@fanf.noc.demon.net>
In-Reply-To: <Pine.BSF.3.95.990225140109.11039G-100000@current1.whistle.com>
References:  <199902252147.NAA01813@vashon.polstra.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Julian Elischer <julian@whistle.com> wrote:
>On Thu, 25 Feb 1999, John Polstra wrote:
>
>[...]
>> 
>> Here, you did the union mount on top of an existing mount point (da1).
>> I don't know for sure, but I suspect that this is the only case in
>> which union mounts are designed to work.
>
>I was led to believe (last time I read the code) that any directory should
>be ok for a union mount....

I was led to believe the same by the manual:

   union   Causes the namespace at the mount point to appear as the
	   union of the mounted filesystem root and the existing di-
	   rectory.  Lookups will be done in the mounted filesystem
	   first.  If those operations fail due to a non-existent
	   file the underlying directory is then accessed.  All cre-
	   ates are done in the mounted filesystem.

I did a brief experiment on the 3.0-RELEASE machine as follows:

# mount
/dev/da0s1a on / (local, writes: sync 1163 async 18438)
procfs on /proc (local)
/dev/da0s1e on /usr (local, writes: sync 363 async 41653)
/dev/da1s1e on /www/da1 (local, writes: sync 12 async 38)
# ls da1/subdir
this_is_da1
# mount -o union /dev/da2s1e da1/subdir
# ls da1/subdir
this_is_da1  this_is_da2
#

So that machine is happy enough with union nounts on top of subdirectories.

On the 3.1-STABLE machine, I tried union mounting on top of a mount
point:

# mount
/dev/da0s1a on / (local, writes: sync 9824 async 55852)
/dev/da0s1e on /www (local, writes: sync 5484 async 10400)
procfs on /proc (local)
/dev/da0s1f on /srcdelta (local, writes: sync 2569 async 2659)
# ls /srcdelta
thing
# ls /www
apache  obj
# umount /srcdelta
# mount -o union /dev/da0s1f /www
# ls /www
thing
#

Still no joy.

Is it sorrect that this magic is implemented in sys/kern/vfs_lookup.c?
The odd thing is that AFAICS no-one has made significant changes to
this code.

Tony.
-- 
f.a.n.finch  dot@dotat.at  fanf@demon.net


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?E10GNQx-0002lU-00>