md(8) panic
Pawel Jakub Dawidek
pjd at FreeBSD.org
Thu May 13 06:06:47 PDT 2004
On Thu, May 13, 2004 at 03:58:02PM +0300, Alex Lyashkov wrote:
+> > 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
But your fix is incorrect:
mdio->md_size = 20
sc->secsize = 512
In my version:
sc->nsect = (20 * 512) / 512 = 20
In your version:
sc->nsect = (20 / 512) * 512 = 0
--
Pawel Jakub Dawidek http://www.FreeBSD.org
pjd at FreeBSD.org http://garage.freebsd.pl
FreeBSD committer Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20040513/ae1d368f/attachment.bin
More information about the freebsd-hackers
mailing list