From mi@guest.ziplink.net  Sun Sep  8 11:15:54 1996
Received: from who.cdrom.com (who.cdrom.com [204.216.27.3])
          by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id LAA13722
          for <FreeBSD-gnats-submit@freebsd.org>; Sun, 8 Sep 1996 11:15:46 -0700 (PDT)
Received: from guest.ziplink.net (guest.zipnet.net [199.232.255.51])
          by who.cdrom.com (8.7.5/8.6.11) with ESMTP id LAA02163
          for <FreeBSD-gnats-submit@freebsd.org>; Sun, 8 Sep 1996 11:15:40 -0700 (PDT)
Received: (from root@localhost) by guest.ziplink.net (8.7.5/8.7.3) id OAA18945; Sun, 8 Sep 1996 14:13:07 -0400 (EDT)
Message-Id: <199609081813.OAA18945@guest.ziplink.net>
Date: Sun, 8 Sep 1996 14:13:07 -0400 (EDT)
From: root@aldan.ziplink.net
Reply-To: mi@aldan.ziplink.net
To: FreeBSD-gnats-submit@freebsd.org
Subject: Weird behavior of the mounted with -ounion directory
X-Send-Pr-Version: 3.2

>Number:         1584
>Category:       kern
>Synopsis:       [unionfs] same file is listed twice
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Sep  8 11:20:01 PDT 1996
>Closed-Date:    Fri May 23 10:36:48 PDT 1997
>Last-Modified:  Fri May 23 10:37:22 PDT 1997
>Originator:     Mikhail Teterin
>Release:        FreeBSD 2.2-960801-SNAP i386
>Organization:
>Environment:

	Two FreeBSD machines --
		guest: FreeBSD 2.2-960801-SNAP i386 as machine1 (Pentium-133)
	----------------------------------------
	/dev/sd2a on / (NFS exported, local)
	/dev/sd2s1e on /var (asynchronous, NFS exported, local)
	procfs on /proc (local)
	aldan:/usr/local on /usr/local (union)
	aldan:/usr/lib on /usr/lib (union)
	aldan:/usr/X11R6 on /usr/X11R6 (union)
	aldan:/home on /home (union)
	aldan:/dump on /dump
	aldan:/root on /root
	aldan:/usr/ports on /usr/ports
	aldan:/var/mail on /var/mail (union)
	/dev/cd0a on /cdrom (NFS exported, local, read-only)

		aldan: FreeBSD 2.1.0-RELEASE #0 as machine2 client (486DX66)
	----------------------------------------
	/dev/sd0a on / (NFS exported, local)
	/dev/sd0s1 on /diskc (NFS exported, local)
	/dev/sd1s3 on /diskd (NFS exported, local)
	/dev/sd2s1e on /usr (NFS exported, local)
	/dev/sd1s1e on /dump (asynchronous, NFS exported, local)
	procfs on /proc (local)

>Description:

	Machine2 mounts a cd-rom from machine1 in the following manner:

	mount -t nfs -ounion,-i guest:/cdrom/ports/distfiles /dump/distfiles/

	There is a partially fetched 
-rw-rw-r--  1 root  wheel  130048 Jan 24  1995 /dump/distfiles/xv-3.10a.tar.gz
	already.
	After successfull mount, there are two
-rw-r--r--  1 2035  wheel  2259124 Jun 11 19:20 /dump/distfiles/xv-3.10a.tar.gz
-rw-r--r--  1 2035  wheel  2259124 Jun 11 19:20 /dump/distfiles/xv-3.10a.tar.gz
	files.

	After carefull investigation :) I discovered, that there are few more
	files listed twice:

	root@aldan:~ (1177) ls -1 /dump/distfiles/ | wc -l
	     638
	root@aldan:~ (1178) ls -1 /dump/distfiles/ | sort -u | wc -l
	     611

	Total list of offenders:
		EmiClock-1.0.2.tar.gz
		auis/
		buffer-1.17.tar.gz
		bxform-081.tgz
		fvwm95-2.0.41f.tgz
		gcc-2.7.2-2.7.2p-pl9.diff.gz
		gcc-2.7.2.tar.gz
		knews-0.9.7.tar.gz
		linux_lib-2.0.tar.gz
		mpack-1.5-src.tar.Z
		perl5.002.tar.gz
		procmail-3.11pre4.tar.gz
		recode-3.4.tar.gz
		tcl7.5.tar.gz
		tcsh-6.06.tar.gz
		tk4.1.tar.gz
		tkinfo-0.6.tar.gz
		vim-4.2.tar.gz
		xa2.0_cvid_netbsd386.o.Z
		xa2.0_iv32_netbsd386.o.Z
		xc/
		xearth-1.0.tar.gz
		xevil1.5.tar.Z
		xfm-1.3.2.tar.gz
		xfmail.tar.gz
		xrus_bin.tgz
		xv-3.10a.tar.gz

	Most of the files are exactly same in aldan:/dump/distfiles and in
	guest:/cdrom/ports/distfiles, although some are different. Some of
	them are directories. Seems like only names are compared (behavior
	expected by me :).

>How-To-Repeat:

	See description.

>Fix:
	
	Don't know. Removing the offending files? Defeats the purpose...
	Somehow the algorithm wich is suppoused to merge the list of nodes
	fails...
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: scrappy 
State-Changed-When: Tue Oct 22 22:27:25 PDT 1996 
State-Changed-Why:  

Confirm Status: same file is listed twice 

State-Changed-From-To: feedback->closed 
State-Changed-By: dfr 
State-Changed-When: Fri May 23 10:36:48 PDT 1997 
State-Changed-Why:  
This problem doesn't show up in current.  It was either fixed by Lite2 or 
by kato@freebsd.org's fixes to nullfs and unionfs. 
>Unformatted:
