From owner-freebsd-current Mon Feb 4 8:35:33 2002 Delivered-To: freebsd-current@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 2D96037B4A4; Mon, 4 Feb 2002 08:35:11 -0800 (PST) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id DAA24848; Tue, 5 Feb 2002 03:35:03 +1100 Date: Tue, 5 Feb 2002 03:37:26 +1100 (EST) From: Bruce Evans X-X-Sender: To: Alfred Perlstein Cc: John Polstra , , Subject: Re: Panics in ffs_clusteracct with todays -current In-Reply-To: <20020204080336.A95852@elvis.mu.org> Message-ID: <20020205031909.L23629-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, 4 Feb 2002, Alfred Perlstein wrote: > * Bruce Evans [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