Subject: kern/36284: mount_union fs namespace showing both layers incorrectly
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <gcw@primenet.com.au>
List: netbsd-bugs
Date: 05/07/2007 08:50:01
>Number:         36284
>Category:       kern
>Synopsis:       mount_union fs namespace showing both layers incorrectly
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 07 08:50:01 +0000 2007
>Originator:     Geoff C. Wing
>Release:        NetBSD 4.99.19 (2007-05-07)
>Organization:
>Environment:
System: NetBSD g.primenet.com.au 4.99.19 NetBSD 4.99.19 (G) #0: Mon May 7 11:15:13 EST 2007 gcw@g.primenet.com.au:/usr/netbsd/src/sys/arch/i386/compile/G i386
Architecture: i386
Machine: i386
>Description:
	Files in a union (mount_union) are showing up multiple times if a file
	exists in both upper and lower layers.  This seems to have been
	introduced sometime in the last week.
	
	e.g. when I do

# mount_mfs -s 512m mfs /mnt && mkdir /mnt/obj
# mount_union /mnt/obj /usr/pkgsrc
# tar -xvzf /usr/tmp/gocr-044-overwrite.tgz
graphics/gocr
graphics/gocr/CVS
graphics/gocr/patches
graphics/gocr/patches/patch-aa
graphics/gocr/patches/patch-ab
graphics/gocr/distinfo
graphics/gocr/Makefile
tar: ustar vol 1, 7 files, 10240 bytes read, 0 bytes written in 1 secs (10240 bytes/sec)
# cd graphics/gocr
# /bin/ls -li
total 11
    32 drwxr-xr-x  2 root  wheel  512 Apr 23 15:27 CVS
    32 drwxr-xr-x  2 root  wheel  512 Apr 23 15:27 CVS
341864 -rw-r--r--  1 root  wheel  474 Oct 17  2005 DESCR
    38 -rw-r--r--  1 root  wheel  531 Apr 23 15:28 Makefile
    38 -rw-r--r--  1 root  wheel  531 Apr 23 15:28 Makefile
341872 -rw-r--r--  1 root  wheel  135 Oct 25  2005 PLIST
    37 -rw-r--r--  1 root  wheel  348 Apr 23 15:30 distinfo
    37 -rw-r--r--  1 root  wheel  348 Apr 23 15:30 distinfo
341880 -rw-r--r--  1 root  wheel  351 Oct 25  2005 options.mk
    34 drwxr-xr-x  5 root  wheel  512 Apr 23 15:30 patches
    34 drwxr-xr-x  5 root  wheel  512 Apr 23 15:30 patches
#

	which is certainly not good with it applying each patch twice on build.

>How-To-Repeat:
	mount a union fs.  modify a file.  see duplicates
>Fix:
	?