Date: Wed, 17 May 1995 13:08:43 -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: <199505172008.NAA12294@gndrsh.aac.dev.com>
In-Reply-To: <199505171810.LAA25818@ref.tfs.com> from "Poul-Henning Kamp" at May 17, 95 11:10:14 am
next in thread | previous in thread | raw e-mail | index | archive | help
>
> A typical "one off" error. Please test this patch.
>
> (David, Rod & John please review.)
>
> Poul-Henning
>
> Index: vm_swap.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/vm/vm_swap.c,v
> retrieving revision 1.17
> diff -u -r1.17 vm_swap.c
> --- 1.17 1995/05/14 03:00:10
> +++ vm_swap.c 1995/05/17 18:08:26
> @@ -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.
> - if (blk > dmmax)
> - blk = dmmax;
Should this be another panic condition???
> /* XXX -- we need to exclude the first cluster as above */
> /* but for now, this will work fine... */
> rlist_free(&swaplist, vsbase, vsbase + blk - 1);
>
> --
> Poul-Henning Kamp <phk@login.dknet.dk> -- TRW Financial Systems, Inc.
> 'All relevant people are pertinent' && 'All rude people are impertinent'
> => 'no rude people are relevant'
>
--
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?199505172008.NAA12294>
