Subject: kern/2423: bugs in union-mounts
To: None <gnats-bugs@NetBSD.ORG>
From: Andrew Wheadon <>
List: netbsd-bugs
Date: 05/16/1996 18:06:11
>Number:         2423
>Category:       kern
>Synopsis:       union mounts panic when unmounting, panic when done twice
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu May 16 12:50:03 1996
>Originator:     Andrew Wheadon
The cost of living hasn't affected it's popularity. (Mark Twain)
current	release=doc \ "NetBSD-current mirror"
hostbase=/mit/ftp/pub/NetBSD base=/usr prefix=/usr backup delete use-rel-suffix
>Release:        15.05.96
System: NetBSD wipux2 1.1B NetBSD 1.1B (WIPOOL) #0: Thu May 16 14:57:24 MET DST 1996 toor@wipux2:/src/src/sys/arch/i386/compile/WIPOOL i386

three bugs:	1) panics when unmounting, 2) allows double-mounting,
		which is followed by panic on access, 3) no dependencies
		explained when compiling kernel.
one nicety:	4) union-mounts are not nfs-exportable

	Union mounts panic when trying to unmount them:
mount -t union -o -b /src2/boot/wippc00 /src2/boot/wippc51
ls /src2/boot/wippc51
umount /src2/boot/wippc51
	syscall (22)

	Union mounts are easily mounted twice over each other:

mount /src2/boot/wippc53
mount /src2/boot/wippc53
(this is the output of 'mount')
/dev/sd1g on /src2 type ffs (NFS exported, local)
<below>:/src2/boot/wippc00 on /src2/boot/wippc51 type union
<below>:/src2/boot/wippc00 on /src2/boot/wippc53 type union
<below>:/src2/boot/wippc00 on /src2/boot/wippc55 type union
<below>:/src2/boot/wippc00 on /src2/boot/wippc53 type union

	and when you then try to ls /src2/boot/wippc53 it (naturally)
	panic locking against myself
	syscall (196)
	(I have the (11mb compressed) core-dump for this one)

	When compiling the Kernel and setting 'option UNION', unions
	will still fail to mount. At least one of the following additional
	options are needed to compile a kernel that supports UNION
	NULLFS,UMAPFS (probably NULLFS) but dependency is not defined
	in files*.

<root@wipux2:/src2/boot> mount -v -t nfs wipux2:/src2/boot /mnt
wipux2:/src2/boot on /mnt type nfs
<root@wipux2:/src2/boot> ls /mnt/wippc53
.s      dev/    home/   root/   src2/   usr/
bin/    etc/    mnt/    sbin/   tmp/    var/
<root@wipux2:/src2/boot> mount
<below>:/src2/boot/wippc00 on /src2/boot/wippc53 type union
wipux2:/src2/boot on /mnt type nfs
<root@wipux2:/src2/boot> umount /mnt
<root@wipux2:/src2/boot> mount -v -t nfs wipux2:/src2/boot/wippc53 /mnt
nfs: can't access /src2/boot/wippc53: Permission denied
<root@wipux2:/src2/boot> umount /mnt

As you can tell mounting /src2/boot lets me see the file but
ignores the union, and just shows me truely local files. (ie. the kernel
file on wippc00/netbsd is not listed etc.)
Trying to mount the union-directory fails completely.

	see above.
	1)	??? 
	2)	Do NOT permit mounting same stuff in same place twice.
	3)	somehow add dependencies for config.
	4)	???