From owner-freebsd-current@FreeBSD.ORG Fri Mar 19 18:10:52 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27AD8106567A for ; Fri, 19 Mar 2010 18:10:52 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from smtprelay01.ispgateway.de (smtprelay01.ispgateway.de [80.67.18.43]) by mx1.freebsd.org (Postfix) with ESMTP id AE79F8FC1B for ; Fri, 19 Mar 2010 18:10:51 +0000 (UTC) Received: from [78.34.143.148] (helo=r500.local) by smtprelay01.ispgateway.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.68) (envelope-from ) id 1Nsgen-0002Yp-IX for freebsd-current@freebsd.org; Fri, 19 Mar 2010 19:10:49 +0100 Date: Fri, 19 Mar 2010 19:11:33 +0100 From: Fabian Keil To: freebsd-current@freebsd.org Message-ID: <20100319191133.46fe271c@r500.local> In-Reply-To: <3a142e751003191021p141af009m6acf7d160c890cbb@mail.gmail.com> References: <3a142e751003190508x6a06868ene2e8fd9ddd977f66@mail.gmail.com> <3a142e751003191021p141af009m6acf7d160c890cbb@mail.gmail.com> X-Mailer: Claws Mail 3.7.5 (GTK+ 2.18.7; amd64-portbld-freebsd9.0) X-PGP-KEY-URL: http://www.fabiankeil.de/gpg-keys/freebsd-listen-2008-08-18.asc Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/AKpUFSsrAPmy2dZTU0zOT8b"; protocol="application/pgp-signature" X-Df-Sender: 775067 Subject: Re: newfs_msdos and DVD-RAM X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Mar 2010 18:10:52 -0000 --Sig_/AKpUFSsrAPmy2dZTU0zOT8b Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Paul B Mahol wrote: > FreeBSD 9.0 CURRENT panics when mounting file system created via > newfs_msdos on DVD-RAM disc. > Something to do about divide by zero. I recently had a similar problem with a 16GB iPod. I still haven't managed to actually mount it, but the patch below at least works around the panic. Does it work for you, too? =46rom 682d827f591d703e049274f495bf90f41b27c15f Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Fri, 19 Mar 2010 18:59:49 +0100 Subject: [PATCH] Work around weird msdosfs crash on mount. How can SecPerCl= ust be zero here? --- sys/fs/msdosfs/msdosfs_vfsops.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsop= s.c index f229e91..22913c2 100644 --- a/sys/fs/msdosfs/msdosfs_vfsops.c +++ b/sys/fs/msdosfs/msdosfs_vfsops.c @@ -606,6 +606,12 @@ mountmsdosfs(struct vnode *devvp, struct mount *mp) pmp->pm_firstcluster =3D pmp->pm_rootdirblk + pmp->pm_rootdirsize; } =20 + if (SecPerClust =3D=3D 0) { + printf("SecPerClust is 0? When did this happen?\n"); + error =3D EINVAL; + goto error_exit; + } + pmp->pm_maxcluster =3D (pmp->pm_HugeSectors - pmp->pm_firstcluster) / SecPerClust + 1; pmp->pm_fatsize =3D pmp->pm_FATsecs * DEV_BSIZE; /* XXX not used? */ --=20 1.6.6.2 Fabian --Sig_/AKpUFSsrAPmy2dZTU0zOT8b Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkujvl0ACgkQBYqIVf93VJ28kACguJnUzoumOpJtIQBx55dsPxFt 2LAAoIJviCRzKS4AUoNWpsFqeJvN/ChQ =zzUu -----END PGP SIGNATURE----- --Sig_/AKpUFSsrAPmy2dZTU0zOT8b--