From mitya@tear.demos.su  Mon May 12 05:26:50 2003
Return-Path: <mitya@tear.demos.su>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 7049D37B401
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 12 May 2003 05:26:50 -0700 (PDT)
Received: from tear.demos.su (tear.demos.su [194.87.2.103])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 6EF5E43FE1
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 12 May 2003 05:26:49 -0700 (PDT)
	(envelope-from mitya@tear.demos.su)
Received: from tear.demos.su (localhost [127.0.0.1])
	by tear.demos.su (8.12.9/8.12.9) with ESMTP id h4CCQi7l000631
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 12 May 2003 16:26:44 +0400 (MSD)
	(envelope-from mitya@tear.demos.su)
Received: (from mitya@localhost)
	by tear.demos.su (8.12.9/8.12.9/Submit) id h4CCQhpg000630;
	Mon, 12 May 2003 16:26:43 +0400 (MSD)
Message-Id: <200305121226.h4CCQhpg000630@tear.demos.su>
Date: Mon, 12 May 2003 16:26:43 +0400 (MSD)
From: Dmitry Sivachenko <mitya@cavia.pp.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: FS corruption when using unionfs
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         52110
>Category:       kern
>Synopsis:       [unionfs] FS corruption when using unionfs
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    daichi
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon May 12 05:30:13 PDT 2003
>Closed-Date:    Tue Feb 13 06:16:14 GMT 2007
>Last-Modified:  Tue Feb 13 06:16:14 GMT 2007
>Originator:     Dmitry Sivachenko
>Release:        FreeBSD 5.1-BETA i386
>Organization:
>Environment:
System: FreeBSD tear.demos.su 5.1-BETA FreeBSD 5.1-BETA #0: Mon May 12 15:23:41 MSD 2003 mitya@tear.demos.su:/usr/obj/usr/src/sys/TEAR i386


	
>Description:

See how-to-repeat.

>How-To-Repeat:

{tear}/home/mitya# mount_unionfs -b /usr/ports /mnt
{tear}/home/mitya# rmdir /mnt/misc

Thus, non-empty directory was removed.  Bug #1.

{tear}/home/mitya# umount /mnt
{tear}/home/mitya# ls -laW /mnt
ls: misc: Bad file descriptor
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
total 2
drwxr-xr-x  2 root  wheel  512 12  16:24 .
w---------  0 root  wheel    0  1   1970 ..
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Whiteout DOT-DOT directory appeared.  Filesystem corruption.


>Fix:

	


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->suspended 
State-Changed-By: kris 
State-Changed-When: Sat Oct 11 00:58:40 PDT 2003 
State-Changed-Why:  
unionfs is documented to be broken, so bugs are to be expected. 
suspending the PR pending an interested developer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=52110 
Responsible-Changed-From-To: freebsd-bugs->green 
Responsible-Changed-By: green 
Responsible-Changed-When: Fri Jan 16 11:28:40 PST 2004 
Responsible-Changed-Why:  
I'm trying to track this down. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=52110 

From: "Brian F. Feldman" <green@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Cc: Dmitry Sivachenko <mitya@cavia.pp.ru>
Subject: Re: kern/52110: FS corruption when using unionfs 
Date: Fri, 16 Jan 2004 17:12:53 -0500

 I've tracked this down a bit further.  Specifically, from namei()/lookup() 
 the inode.i_offset is supposed to be set to the offset of the directory 
 entry to be removed.  For some reason, it's reliably being set to that for 
 "..", so ufs_dirremove is always replacing .. with a whiteout instead of the 
 file you mean to remove.
 
 -- 
 Brian Fundakowski Feldman                           \'[ FreeBSD ]''''''''''\
   <> green@FreeBSD.org                               \  The Power to Serve! \
  Opinions expressed are my own.                       \,,,,,,,,,,,,,,,,,,,,,,\
 
 
Responsible-Changed-From-To: green->daichi 
Responsible-Changed-By: rodrigc 
Responsible-Changed-When: Sun May 28 20:17:20 UTC 2006 
Responsible-Changed-Why:  
daichi is showing interest in unionfs 

http://www.freebsd.org/cgi/query-pr.cgi?pr=52110 
State-Changed-From-To: suspended->closed 
State-Changed-By: rodrigc 
State-Changed-When: Tue Feb 13 06:15:54 UTC 2007 
State-Changed-Why:  
New unionfs implementation has been committed to RELENG_6 and CURRENT. 
This bug report is only relevant to the previous version of unionfs. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=52110 
>Unformatted:
