Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Aug 2002 16:20:04 -0700 (PDT)
From:      "Simon L. Nielsen" <simon@nitro.dk>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/37889: kernel panic when writing to a FAT32 partition
Message-ID:  <200208132320.g7DNK4Gj007544@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/37889; it has been noted by GNATS.

From: "Simon L. Nielsen" <simon@nitro.dk>
To: hiten@uk.FreeBSD.org
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: kern/37889: kernel panic when writing to a FAT32 partition
Date: Wed, 14 Aug 2002 01:18:37 +0200

 --+HP7ph2BbKc20aGI
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 On 2002.08.13 15:14:19 +0000, Hiten Pandya wrote:
 
 > >  I have the same problem where it crashes at msdosfs_fat.c:353.
 > OK.  Could you please provide us with your line 353 and the 5 lines before
 > and after it.  This could help me in finding the code.  Also, could you
 > please tell me what your FreeBSD OS version is, better yet, provide us
 > with your ``uname -a'' output.
 Sure :
 FreeBSD arthur.nitro.dk 4.6.1-RELEASE-p10 FreeBSD 4.6.1-RELEASE-p10 #3: Wed=
  Aug 14 00:22:41 CEST 2002     root@arthur.nitro.dk:/usr/src/sys/compile/AR=
 THUR  i386
 
 >From msdosfs_fat.c is :
 1 /* $FreeBSD: src/sys/msdosfs/msdosfs_fat.c,v 1.23 2000/01/27 14:43:06 nya=
 n Exp $ */
 
 348	 * If we have an FSInfo block, update it.
 349	 */
 350	if (pmp->pm_fsinfo) {
 351		u_long cn =3D pmp->pm_nxtfree;
 352
 353		if (pmp->pm_freeclustercount
 354		    && (pmp->pm_inusemap[cn / N_INUSEBITS]
 355			& (1 << (cn % N_INUSEBITS)))) {
 356			/*
 357			 * The cluster indicated in FSInfo isn't free
 
 I tried adding a printf at line 352 to print cn (pmp->pm_nxtfree).. It
 was a very big number (4294967295 in one test - btw. this number is from
 a later crashdump) which might be to large for the pm_inusemap array...
 I have not had time to look more at the msdosfs code to understant
 exactly was that array is...
 
 > >  Sometimes the problem goes away after I have used the partion from
 > >  Windows 2000. Then I can write to the partion from FreeBSD without
 > >  problems and then later after i have used the partion from Windows 2000
 > >  again the problems comes back and i get FreeBSD kernel panics.
 > Strangely, this problem has not been noticed in the developent (-current)
 > version of FreeBSD, so it could be that this problem was solved over time,
 > and someone actually forgot to merge the delta (correction) into the
 > -stable version of FreeBSD.
 I think the problem could have something to do with large partions...
 For a long time I have been using a 20GB FAT32 partion without any,
 problems but my new msdos partion (on a different disc) is 30GB.
 
 I have been looking a bit throu the NetBSD msdos fs code and found a
 change to the NetBSD code that have not been merged in to FreeBSD that
 might have something to do with this problem :
 
 http://mail-index.netbsd.org/source-changes/2000/03/27/0008.html
 
 -- START
 From: Jaromir Dolecek <jdolecek@netbsd.org>
 
 Add new CLUST_END and use it as parameter to pcbmap() when searching
 for end cluster, instead of explicitly passing 0xffff. This fixes potential
 problem for FAT32, where cluster number may be legally bigger than 0xffff.
 
 Also change clusteralloc() so that fillwith is not explicitly passed by cal=
 ler
 anymore (there is no need to use anything other than CLUST_EOFE).
 -- END
 
 I have tried applying the patches from that commit to FreeBSD but it
 doesn't seem to fix the problem (I will try a bit more tomorrow).
 
 My FAT32 partion is on an extented partion... could pehaps make a
 difference.
 
 There is a bit more info about my system and the bug which might be
 useful in the following mail to freebsd-stable :
 
 http://docs.freebsd.org/cgi/getmsg.cgi?fetch=3D16978+0+archive/2002/freebsd=
 -stable/20020804.freebsd-stable
 
 Btw. I have run fsck_msdos and that says the partion is ok now, but the
 first time I ran it there was few errors (can't remember exactly which).
 The first ran was after a panic so that might have be the reason for the
 errors. I don't know if this is important...
 
 --=20
 Simon L. Nielsen
 
 --+HP7ph2BbKc20aGI
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.0.7 (FreeBSD)
 
 iD8DBQE9WZPM8kocFXgPTRwRAosSAKCGe1tfGvyxbo3RoxhfBgwWkLcw+ACggPg+
 uowoTSf5uyq8TkBZPfhv5/g=
 =TIhB
 -----END PGP SIGNATURE-----
 
 --+HP7ph2BbKc20aGI--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200208132320.g7DNK4Gj007544>