From owner-freebsd-current@FreeBSD.ORG Fri Apr 2 10:57:34 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 EB7241065672; Fri, 2 Apr 2010 10:57:34 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from smtprelay01.ispgateway.de (smtprelay01.ispgateway.de [80.67.31.28]) by mx1.freebsd.org (Postfix) with ESMTP id 76EC08FC2A; Fri, 2 Apr 2010 10:57:34 +0000 (UTC) Received: from [78.34.138.217] (helo=r500.local) by smtprelay01.ispgateway.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.68) (envelope-from ) id 1NxeZ8-0000LQ-4F; Fri, 02 Apr 2010 12:57:30 +0200 Date: Fri, 2 Apr 2010 12:57:21 +0200 From: Fabian Keil To: Andriy Gapon Message-ID: <20100402125721.50b3ba4f@r500.local> In-Reply-To: <4BB360A1.7020309@freebsd.org> References: <3a142e751003190508x6a06868ene2e8fd9ddd977f66@mail.gmail.com> <3a142e751003191021p141af009m6acf7d160c890cbb@mail.gmail.com> <20100319191133.46fe271c@r500.local> <3a142e751003191126j331e525fwb9e5573bbf6f7d58@mail.gmail.com> <4BAA30CB.1070707@icyb.net.ua> <20100328172537.501ed3d1@r500.local> <4BB0A053.9060007@freebsd.org> <20100329222920.5eef6395@r500.local> <4BB111D4.8060809@freebsd.org> <20100330173637.202b4b1e@r500.local> <4BB21BBA.7030407@freebsd.org> <4BB360A1.7020309@freebsd.org> 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_/o/kR2pAzI.De4I0myI6/YxS"; protocol="application/pgp-signature" X-Df-Sender: 775067 Cc: Kostik Belousov , freebsd-current@freebsd.org, Bruce Evans 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, 02 Apr 2010 10:57:35 -0000 --Sig_/o/kR2pAzI.De4I0myI6/YxS Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Andriy Gapon wrote: > on 30/03/2010 18:41 Andriy Gapon said the following: > > on 30/03/2010 18:36 Fabian Keil said the following: > >> Andriy Gapon wrote: > >> > >>> on 29/03/2010 23:29 Fabian Keil said the following: > >>>> Andriy Gapon wrote: > >>>>> Thus, clearly, it is a fault of a tool that formatted the media > >>>>> for FAT. It should have picked correct values, or rejected > >>>>> incorrect values if those were provided as overrides via command > >>>>> line options. > >>>> The kernel still shouldn't panic, though. > >>> A quick reply to this point only - yes, I completely agree. > >>> But remember that the panic happened only after the sources were > >>> modified :) > >> It wasn't clear from my message, but I was mainly referring to the > >> division-by-zero panic mentioned at the beginning of the thread, > >> for which I posted a work-around in > >> <20100319191133.46fe271c@r500.local>. > >=20 > > Oh, yes, right. >=20 > To clarify - I already forgot that the original problem was division by > zero panic and for some reason thought that it was EINVAL. >=20 > Anyways, here is a patch that I would use. > Unfortunately, ENOTIME to understand newfs_msdos code and fix it too, >=20 > --- a/sys/fs/msdosfs/msdosfs_vfsops.c > +++ b/sys/fs/msdosfs/msdosfs_vfsops.c > @@ -580,6 +580,7 @@ mountmsdosfs(struct vnode *devvp, struct mount *mp) > || (pmp->pm_BytesPerSec & (pmp->pm_BytesPerSec - 1)) > || (pmp->pm_HugeSectors =3D=3D 0) > || (pmp->pm_FATsecs =3D=3D 0) > + || (SecPerClust * pmp->pm_BlkPerSec > MAXBSIZE / DEV_BSIZE) > ) { > error =3D EINVAL; > goto error_exit; That works, too: fk@r500 ~ $sudo mdconfig -a -t vnode -f /tank/ipod-image-formatiert md0 fk@r500 ~ $sudo mount_msdosfs /dev/md0 /mnt/ mount_msdosfs: /dev/md0: Invalid argument Is there a chance that this, or some other workaround, could be committed? Fabian --Sig_/o/kR2pAzI.De4I0myI6/YxS Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAku1zZkACgkQBYqIVf93VJ0rngCfW1moJAdVxsBXDk/MqvoaPVMk hAUAnjlIrt+LWKhTO0PHnclwp/oBfQYD =L5dg -----END PGP SIGNATURE----- --Sig_/o/kR2pAzI.De4I0myI6/YxS--