NetBSD Problem Report #14839

Received: (qmail 6905 invoked from network); 4 Dec 2001 13:30:57 -0000
Message-Id: <200112041330.OAA20239@danbala.tuwien.ac.at>
Date: Tue, 4 Dec 2001 14:30:48 +0100 (MET)
From: wiz@netbsd.org
Reply-To: wiz@netbsd.org
To: gnats-bugs@gnats.netbsd.org
Subject: msdosfs bug in moving directories
X-Send-Pr-Version: 3.95

>Number:         14839
>Category:       kern
>Synopsis:       msdosfs bug in moving directories
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    jdolecek
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Dec 04 13:31:00 +0000 2001
>Closed-Date:    Fri Mar 08 22:09:04 +0000 2002
>Last-Modified:  Fri Dec 21 18:26:13 +0000 2012
>Originator:     Thomas Klausner
>Release:        1.5Y/i386
>Organization:
>Environment:

>Description:
Moving a directory on msdosfs corrupts the msdos file system.
>How-To-Repeat:
Example session:
wiz@hiro:/disk/msdos> mkdir a
wiz@hiro:/disk/msdos> cd a
wiz@hiro:/disk/msdos/a> du
8       .
wiz@hiro:/disk/msdos/a> mkdir b
wiz@hiro:/disk/msdos/a> du
8       ./b
16      .
wiz@hiro:/disk/msdos/a> mkdir ../c
wiz@hiro:/disk/msdos/a> mv ../c .
wiz@hiro:/disk/msdos/a> du
8       ./b
du: fts_read: No such file or directory
wiz@hiro:/disk/msdos/a>

>Fix:
None provided.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: kern-bug-people->jdolecek 
Responsible-Changed-By: jdolecek 
Responsible-Changed-When: Tue Dec 4 13:09:35 PST 2001 
Responsible-Changed-Why:  
I'll look at this. 

From: Jaromir Dolecek <jaromir.dolecek@artisys.cz>
To: gnats-bugs@NetBSD.org
Cc:  
Subject: Re: kern/14839: msdosfs bug in moving directories
Date: Tue, 8 Jan 2002 16:19:58 +0100 (CET)

 Hi Thomas,
 I've been unable to repeat this problem with yesterday kernel,
 using a mounted floppy. Can you confirm whether the problem
 still happens with later kernel?
 I have some local fixes here (chasing different bug), but
 those should not affect this.

 Jaromir
State-Changed-From-To: open->feedback 
State-Changed-By: jdolecek 
State-Changed-When: Tue Jan 8 12:52:40 PST 2002 
State-Changed-Why:  
Is this still a problem? 

From: Jaromir Dolecek <jdolecek@netbsd.org>
To: Thomas Klausner <wiz@netbsd.org>
Cc: gnats-bugs@netbsd.org
Subject: Re: kern/14839
Date: Tue, 8 Jan 2002 22:52:01 +0100 (CET)

 Thomas Klausner wrote:
 > Your mail about the problem didn't reach me, I only just now foundit
 > in gnats.
 > 
 > I can't reproduce the problem with a floppy either, but it's still
 > there on an 9GB msdosfs on a hard disc, kernel from January 6.

 Hum, now that's getting interesting :)

 Perhaps the bug only happens with FAT32? Can you try to mount the
 floppy with -l (mount_msdos -l /dev/fd0a  /whatever) and try the
 steps with that?

 Jaromir

From: stephenm@employees.org (Stephen Ma)
To: Jaromir Dolecek <jdolecek@netbsd.org>, Thomas Klausner <wiz@netbsd.org>
Cc: gnats-bugs@netbsd.org
Subject: Re: kern/14839 
Date: Fri, 1 Feb 2002 13:43:41 -0800

 > Perhaps the bug only happens with FAT32? Can you try to mount the
 > floppy with -l (mount_msdos -l /dev/fd0a  /whatever) and try the
 > steps with that?

 Hi.

 I ran into the same bug a long time back, but didn't get a chance to
 followup at the time. However, seeing Jaromir's suggestion about FAT32
 helped with tracking it down.

 See if applying the appended patch on the following file helps:

 msdosfs_vnops.c:
      $NetBSD: msdosfs_vnops.c,v 1.119 2002/01/08 20:11:00 jdolecek Exp $

 - S

 -- 

 --- /v1/netbsd/src/sys/msdosfs/msdosfs_vnops.c	Wed Jan  9 04:38:29 2002
 +++ msdosfs_vnops.c	Fri Feb  1 12:45:10 2002
 @@ -1120,6 +1120,10 @@
  		}
  		dotdotp = (struct direntry *)bp->b_data + 1;
  		putushort(dotdotp->deStartCluster, dp->de_StartCluster);
 +		if (FAT32(pmp)) {
 +			putushort(dotdotp->deHighClust, dp->de_StartCluster >> 16);
 +		}
 +
  		if ((error = bwrite(bp)) != 0) {
  			/* XXX should really panic here, fs is corrupt */
  			VOP_UNLOCK(fvp, 0);


From: Jaromir Dolecek <jdolecek@netbsd.org>
To: Stephen Ma <stephenm@employees.org>
Cc: Thomas Klausner <wiz@netbsd.org>, gnats-bugs@netbsd.org
Subject: Re: kern/14839
Date: Sat, 2 Feb 2002 19:55:48 +0100 (CET)

 Stephen Ma wrote:
 > See if applying the appended patch on the following file helps:

 Wow, cool! Looks good, can you Thomas test it, please?

 Jaromir 

From: Thomas Klausner <wiz@netbsd.org>
To: Jaromir Dolecek <jdolecek@netbsd.org>
Cc: Stephen Ma <stephenm@employees.org>, gnats-bugs@netbsd.org
Subject: Re: kern/14839
Date: Thu, 7 Feb 2002 15:55:17 +0100

 On Sat, Feb 02, 2002 at 07:55:48PM +0100, Jaromir Dolecek wrote:
 > Stephen Ma wrote:
 > > See if applying the appended patch on the following file helps:
 > 
 > Wow, cool! Looks good, can you Thomas test it, please?

 Yes, this makes my dir-move-problem go away -- thanks!
 I can't comment on the correctness, though, since I don't have a clue
 in that area, sorry.

 Bye,
  Thomas

 -- 
 Thomas Klausner - wiz@danbala.tuwien.ac.at
 When all other means of communication fail, try words.
State-Changed-From-To: feedback->analyzed 
State-Changed-By: wiz 
State-Changed-When: Tue Mar 5 06:55:12 PST 2002 
State-Changed-Why:  
Feedback supplied. 
State-Changed-From-To: analyzed->closed 
State-Changed-By: jdolecek 
State-Changed-When: Fri Mar 8 14:08:18 PST 2002 
State-Changed-Why:  
The fix provided by Stephen Ma commited in rev.1.120 of 
sys/msdosfs/msdosfs_vnops.c. 
Thanks for report. 

>Unformatted:

NetBSD Home
NetBSD PR Database Search

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