Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Feb 2002 03:37:26 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Alfred Perlstein <bright@mu.org>
Cc:        John Polstra <jdp@polstra.com>, <current@FreeBSD.ORG>, <markm@FreeBSD.ORG>
Subject:   Re: Panics in ffs_clusteracct with todays -current
Message-ID:  <20020205031909.L23629-100000@gamplex.bde.org>
In-Reply-To: <20020204080336.A95852@elvis.mu.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 4 Feb 2002, Alfred Perlstein wrote:

> * Bruce Evans <bde@zeta.org.au> [020204 05:26] wrote:
> > This patch just backs out the change to NBBY.
>
> Wouldn't this make more sense:
>
> Index: ffs/ffs_alloc.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/ufs/ffs/ffs_alloc.c,v
> retrieving revision 1.86
> diff -u -r1.86 ffs_alloc.c
> --- ffs/ffs_alloc.c	2 Feb 2002 01:42:44 -0000	1.86
> +++ ffs/ffs_alloc.c	4 Feb 2002 16:08:34 -0000
> @@ -1790,7 +1790,7 @@
>  	end = start + fs->fs_contigsumsize;
>  	if (end >= cgp->cg_nclusterblks)
>  		end = cgp->cg_nclusterblks;
> -	mapp = &freemapp[start / NBBY];
> +	mapp = &freemapp[start < 0 ? 0 : start / NBBY];
>  	map = *mapp++;
>  	bit = 1 << (start % NBBY);
>  	for (i = start; i < end; i++) {
>

Except it doesn't fix the potentially millions of other lines that are
affected by the fix, and leaves at best confusing code: mapp, map and
bit are unitialized to bogus values.  This seems to be harmless because
they are not used (the loop is iterated 0 times if start < 0).

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




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