Date: Thu, 13 May 2004 15:58:02 +0300 From: Alex Lyashkov <shadow@psoft.net> To: Pawel Jakub Dawidek <pjd@FreeBSD.org> Cc: freebsd-hackers@FreeBSD.org Subject: Re: md(8) panic Message-ID: <1084453082.7881.17.camel@berloga.shadowland> In-Reply-To: <20040513122919.GQ845@darkness.comp.waw.pl> References: <1084367285.88529.35.camel@singsing> <20040513122919.GQ845@darkness.comp.waw.pl>
index | next in thread | previous in thread | raw e-mail
В Чтв, 13.05.2004, в 15:29, Pawel Jakub Dawidek пишет: > On Wed, May 12, 2004 at 02:08:05PM +0100, Mike Bristow wrote: > +> Hi, > +> > +> I am trying to access some ancient 5 1/4" floppies, with 256 byte > +> sectors. Leaving aside the interesting hardware problems, the > +> filesystem on these disks is (surprisingly enough) not supported on > +> -CURRENT. While attempting to write one, I ran: > +> > +> # mdconfig -a -t malloc -S 256 -s 20 > +> > +> Thinking that this would give me some fake media to play with. Instead, > +> it panics the box. > +> > +> This happens at line 809 of md.c version 1.222 which says: > +> > +> sc->nsect /= (sc->secsize / DEV_BSIZE); > +> > +> (where sc->secsize has been initialised to 256, as per > +> my request). > +> > +> It would be easy to check for, and reject, such requests, but should > +> md(8) allow people to create such devices? Or am I being silly in even > +> asking for it? > > This sector size is valid and shouldn't be rejected. > This patch works for me: > > http://people.freebsd.org/~pjd/patches/md.c.3.patch in patch + sc->nsect = (mdio->md_size * DEV_BSIZE) / sc->secsize; why not + sc->nsect = (mdio->md_size / sc->secsize ) * DEV_BSIZE ; for avoid posible overflow in mdio->md_size * DEV_BSIZE -- Alex Lyashkov <shadow@psoft.net> PSofthelp
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1084453082.7881.17.camel>
