NetBSD Problem Report #43616

From www@NetBSD.org  Wed Jul 14 17:24:23 2010
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 8B18863BADF
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 14 Jul 2010 17:24:23 +0000 (UTC)
Message-Id: <20100714172423.5115863BACE@www.NetBSD.org>
Date: Wed, 14 Jul 2010 17:24:23 +0000 (UTC)
From: pooka@iki.fi
Reply-To: pooka@iki.fi
To: gnats-bugs@NetBSD.org
Subject: msdosfs rename dir dir/.. fails with EROFS instead of expected EINVAL
X-Send-Pr-Version: www-1.0

>Number:         43616
>Category:       kern
>Synopsis:       msdosfs rename dir dir/.. fails with EROFS instead of expected EINVAL
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 14 17:25:00 +0000 2010
>Closed-Date:    Sat Aug 10 17:57:12 +0000 2013
>Last-Modified:  Sat Aug 10 17:57:12 +0000 2013
>Originator:     Antti Kantee
>Release:        
>Organization:
>Environment:
>Description:
summary says it all.  will commit test soon.
>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:
From: Antti Kantee <pooka@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/43616 CVS commit: src/tests/fs/vfs
Date: Wed, 14 Jul 2010 20:45:49 +0000

 Module Name:	src
 Committed By:	pooka
 Date:		Wed Jul 14 20:45:49 UTC 2010

 Modified Files:
 	src/tests/fs/vfs: t_vnops.c

 Log Message:
 Add an assortment of rename tests.  Not complete, but at least tests
 something.

 This contains the tests for PR kern/43616 and PR kern/43617.


 To generate a diff of this commit:
 cvs rdiff -u -r1.1 -r1.2 src/tests/fs/vfs/t_vnops.c

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

From: Michael van Elst <mlelstv@serpens.de>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/43616 msdosfs rename dir dir/.. fails with EROFS instead
 of expected EINVAL
Date: Fri, 30 Jul 2010 09:51:37 +0200

 The wrong errno is returned for rename and delete operations
 to the root directory.

 # mount -t msdos /dev/vnd0d /mnt
 # cd /mnt
 # rmdir .
 rmdir: .: Read-only file system
 # mkdir a
 # cd a
 # rmdir .
 rmdir: .: Invalid argument


 This change should fix the problem.

 Index: msdosfs_lookup.c
 ===================================================================
 RCS file: /cvsroot/src/sys/fs/msdosfs/msdosfs_lookup.c,v
 retrieving revision 1.21
 diff -u -r1.21 msdosfs_lookup.c
 --- msdosfs_lookup.c	24 Jun 2010 13:03:09 -0000	1.21
 +++ msdosfs_lookup.c	30 Jul 2010 07:45:06 -0000
 @@ -461,7 +461,7 @@
  		 * Don't allow deleting the root.
  		 */
  		if (blkoff == MSDOSFSROOT_OFS)
 -			return EROFS;			/* really? XXX */
 +			return EINVAL;

  		/*
  		 * Write access to directory required to delete files.
 @@ -497,7 +497,7 @@
  			return (EROFS);

  		if (blkoff == MSDOSFSROOT_OFS)
 -			return EROFS;				/* really? XXX */
 +			return EINVAL;

  		error = VOP_ACCESS(vdp, VWRITE, cnp->cn_cred);
  		if (error)


 -- 
                                 Michael van Elst
 Internet: mlelstv@serpens.de
                                 "A potential Snark may lurk in every tree."

From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/43616 msdosfs rename dir dir/.. fails with EROFS instead
 of expected EINVAL
Date: Fri, 30 Jul 2010 14:06:09 +0000

 On Fri, Jul 30, 2010 at 07:55:02AM +0000, Michael van Elst wrote:
  >  The wrong errno is returned for rename and delete operations
  >  to the root directory.
  >  
  >  This change should fix the problem.

 please commit

 -- 
 David A. Holland
 dholland@netbsd.org

State-Changed-From-To: open->pending-pullups
State-Changed-By: mlelstv@NetBSD.org
State-Changed-When: Fri, 30 Jul 2010 16:50:41 +0000
State-Changed-Why:
committed to head and requested pullups to netbsd-5 and netbsd-4.


State-Changed-From-To: pending-pullups->closed
State-Changed-By: snj@NetBSD.org
State-Changed-When: Sat, 10 Aug 2013 17:57:12 +0000
State-Changed-Why:
Pulled up.


>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.