Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 May 1995 13:23:03 -0700 (PDT)
From:      "Rodney W. Grimes" <rgrimes@gndrsh.aac.dev.com>
To:        phk@ref.tfs.com (Poul-Henning Kamp)
Cc:        current@FreeBSD.org
Subject:   Re: please test this patch for panic("swfree")
Message-ID:  <199505172023.NAA12370@gndrsh.aac.dev.com>
In-Reply-To: <199505172015.NAA26175@ref.tfs.com> from "Poul-Henning Kamp" at May 17, 95 01:15:36 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> > > @@ -241,15 +241,11 @@
> > >  	sp->sw_nblks = nblks;
> > >  
> > >  	if (nblks * nswdev > nswap)
> > > -		nswap = nblks * nswdev;
> > > +		nswap = (nblks+1) * nswdev;
> > 
> > Okay!
> > 
> > >  
> > >  	for (dvbase = dmmax; dvbase < nblks; dvbase += dmmax) {
> > >  		blk = nblks - dvbase;
> > >  
> > > -		if ((vsbase = index * dmmax + dvbase * nswdev) >= nswap)
> > > -			panic("swfree");
> > 
> > Not Okay, please correct the calculation to do the right check, not
> > eliminate the sanify check.
> > 
> Rod, if you do your math, you will see that this cannot fail.

It can fail if any of the values for some other off by one error goes
out of range!

> 
> > > -			blk = dmmax;
> > 
> > Should this be another panic condition???
> 
> See other email.

See other mail, some one is now panicing in the call right after this.

ARGHHH!!!  This is not the time to have to start in on debugging this
type of problem!


-- 
Rod Grimes                                      rgrimes@gndrsh.aac.dev.com
Accurate Automation Company                   Custom computers for FreeBSD



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