NetBSD Problem Report #47987

From reinoud@heethoofdje.13thmonkey.org  Wed Jul  3 10:49:38 2013
Return-Path: <reinoud@heethoofdje.13thmonkey.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 6DC147148D
	for <gnats-bugs@gnats.NetBSD.org>; Wed,  3 Jul 2013 10:49:38 +0000 (UTC)
Message-Id: <20130703095030.2A6F6281936D@heethoofdje.13thmonkey.org>
Date: Wed,  3 Jul 2013 11:50:30 +0200 (CEST)
From: reinoud@NetBSD.org
Reply-To: reinoud@NetBSD.org
To: gnats-bugs@gnats.NetBSD.org
Subject: Issues with removing directories in UDF
X-Send-Pr-Version: 3.95

>Number:         47987
>Category:       kern
>Synopsis:       Issues with removing directories in UDF
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    reinoud
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 03 10:50:00 +0000 2013
>Closed-Date:    Sun Jul 07 20:51:55 +0000 2013
>Last-Modified:  Sun Jul 07 20:51:55 +0000 2013
>Originator:     Reinoud Zandijk
>Release:        NetBSD 6.99.23
>Organization:
NetBSD

>Environment:


>Description:
The t_vnops/udf_nor_notempty and the t_vnops/udf_dir_rmdirdotdot fail.

----
Test case: fs/vfs/t_vnops/udf_dir_notempty

Duration: 0.920299 seconds
Termination reason

FAILED: non-empty directory removed succesfully
Standard output stream


Test case: fs/vfs/t_vnops/udf_dir_rmdirdotdot

Duration: 0.912503 seconds
Termination reason

FAILED:
/tmp/bracket/build/2013.07.02.22.39.45-amd64/src/tests/fs/vfs/t_vnops.c:181:
Expected errno 2, got 22, in rump_sys_chdir("..") == -1
Standard output stream

----


>How-To-Repeat:
Run the tests

>Fix:
The rmdir '..' case ought to be trivial to fix, the other needs some
attention. It turns out that the reference count udf is using there is only
counting references TO the directory and not, as abusively is presumed, the
number of files too.



>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: kern-bug-people->reinoud
Responsible-Changed-By: reinoud@NetBSD.org
Responsible-Changed-When: Wed, 03 Jul 2013 10:51:00 +0000
Responsible-Changed-Why:
UDF is mine to take


From: "Reinoud Zandijk" <reinoud@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/47987 CVS commit: src/sys/fs/udf
Date: Wed, 3 Jul 2013 14:35:29 +0000

 Module Name:	src
 Committed By:	reinoud
 Date:		Wed Jul  3 14:35:29 UTC 2013

 Modified Files:
 	src/sys/fs/udf: udf_vnops.c

 Log Message:
 On removing a directory make sure the leaf directory doesn't have a valid '..'
 link anymore. In a corner case this leaf can be held by a process as a CWD. It
 is guaranteed to be empty at this stage so we trunc it removing the only valid
 FID, being the '..' entry.

 Solves part of PR kern/47987
 Solves tests/vfs/t_vnops udf_dir_rmdirdotdot


 To generate a diff of this commit:
 cvs rdiff -u -r1.77 -r1.78 src/sys/fs/udf/udf_vnops.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Reinoud Zandijk" <reinoud@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/47987 CVS commit: src/sys/fs/udf
Date: Sun, 7 Jul 2013 19:49:44 +0000

 Module Name:	src
 Committed By:	reinoud
 Date:		Sun Jul  7 19:49:44 UTC 2013

 Modified Files:
 	src/sys/fs/udf: udf_subr.c udf_subr.h udf_vnops.c

 Log Message:
 Implement a real empty-directory checking for rmdir().

 Should should fix the other part of PR kern/47987
 Solves tests/vfs/t_vnops udf_dir_notempty


 To generate a diff of this commit:
 cvs rdiff -u -r1.119 -r1.120 src/sys/fs/udf/udf_subr.c
 cvs rdiff -u -r1.18 -r1.19 src/sys/fs/udf/udf_subr.h
 cvs rdiff -u -r1.81 -r1.82 src/sys/fs/udf/udf_vnops.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: reinoud@NetBSD.org
State-Changed-When: Sun, 07 Jul 2013 20:51:55 +0000
State-Changed-Why:
Fixed the problem. Tested both with manual check and with the atf framework


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.