NetBSD Problem Report #1513
From gnats Tue Sep 26 00:37:28 1995
Received: from bloom-beacon.MIT.EDU (brnstndkramden.acf.nyu.edu@BLOOM-BEACON.MIT.EDU [18.181.0.26]) by sun-lamp.pc.cs.cmu.edu (8.6.11/8.6.10) with ESMTP id AAA07727 for <gnats-bugs@gnats.netbsd.org>; Tue, 26 Sep 1995 00:37:27 -0400
Message-Id: <199509260316.XAA00395@pattern.arlington.ma.us>
Date: Mon, 25 Sep 1995 23:16:13 -0400
From: John Kohl <jtk@kolvir.arlington.ma.us>
Reply-To: jtk@kolvir.arlington.ma.us
To: gnats-bugs@gnats.netbsd.org
Subject: msdosfs panics (locking against myself) with mv foo.xxx foo.xxx.~1~
X-Send-Pr-Version: 3.95
>Number: 1513
>Category: kern
>Synopsis: msdosfs panics (locking against myself) with mv foo.xxx foo.xxx.~1~
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: kern-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Sep 26 00:50:04 +0000 1995
>Closed-Date: Thu May 16 03:34:20 +0000 1996
>Last-Modified: Thu May 16 03:35:02 +0000 1996
>Originator: John Kohl
>Release: NetBSD-current, roughly 1995/09/22
>Organization:
NetBSD Kernel Hackers `R` Us
>Environment:
System: NetBSD pattern 1.0A NetBSD 1.0A (PATTERN) #128: Mon Sep 25 23:09:21 EDT 1995 jtk@pattern:/u1/NetBSD-current/src/sys/arch/i386/compile/PATTERN i386
>Description:
in msdosfs, this will panic a system with DIAGNOSTIC or hang a process
without DIAGNOSTIC:
% mv foo.xxx foo.xxx.~1~
>How-To-Repeat:
do that
>Fix:
===================================================================
RCS file: RCS/msdosfs_vnops.c,v
retrieving revision 1.1
diff -c -r1.1 msdosfs_vnops.c
*** msdosfs_vnops.c 1995/09/26 02:42:21 1.1
--- msdosfs_vnops.c 1995/09/26 03:08:47
***************
*** 876,882 ****
vrele(fvp);
return (error);
}
!
/*
* Convert the filename in tcnp into a dos filename. We copy this
* into the denode and directory entry for the destination
--- 876,903 ----
vrele(fvp);
return (error);
}
! /*
! * Check for rename onto itself. e.g. rename("foo.emu", "foo.emu.~1~")
! * which appears to the vnode layer as just like renaming one
! * hardlinked file onto the other. It happens here due to name
! * mapping.
! * (Can it happen due to hard links in a corrupted file system?
! * should we worry about that?)
! */
! if (fvp == tvp) {
! /*
! * the "to" name is valid, but so is the "from" name.
! * what should we return as an error code?
! * 0 is not quite right--the source still exists and the user
! * may have uttered different file names. However, it's probably
! * the closest to correct.
! *
! * maybe EMLINK?
! */
! error = 0 /*EMLINK*/;
! goto abortit;
! }
!
/*
* Convert the filename in tcnp into a dos filename. We copy this
* into the denode and directory entry for the destination
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed
State-Changed-By: jtk
State-Changed-When: Wed May 15 23:34:20 EDT 1996
State-Changed-Why:
The changes post-1.1 for Win95 and other support fix this case as well
for old (non-Win95) DOS partitions.
.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.