Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Mar 2010 17:48:01 +0300
From:      Andriy Gapon <avg@freebsd.org>
To:        Fabian Keil <freebsd-listen@fabiankeil.de>
Cc:        Kostik Belousov <kostikbel@gmail.com>, freebsd-current@freebsd.org, Bruce Evans <bde@zeta.org.au>
Subject:   Re: newfs_msdos and DVD-RAM
Message-ID:  <4BB360A1.7020309@freebsd.org>
In-Reply-To: <4BB21BBA.7030407@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>

next in thread | previous in thread | raw e-mail | index | archive | help
on 30/03/2010 18:41 Andriy Gapon said the following:
> on 30/03/2010 18:36 Fabian Keil said the following:
>> Andriy Gapon <avg@freebsd.org> wrote:
>>
>>> on 29/03/2010 23:29 Fabian Keil said the following:
>>>> Andriy Gapon <avg@freebsd.org> 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>.
> 
> Oh, yes, right.

To clarify - I already forgot that the original problem was division by zero panic
and for some reason thought that it was EINVAL.

Anyways, here is a patch that I would use.
Unfortunately, ENOTIME to understand newfs_msdos code and fix it too,

--- 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 == 0)
 	  || (pmp->pm_FATsecs == 0)
+	  || (SecPerClust * pmp->pm_BlkPerSec > MAXBSIZE / DEV_BSIZE)
 	) {
 		error = EINVAL;
 		goto error_exit;


-- 
Andriy Gapon



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