From owner-freebsd-fs Thu Dec 5 21:35:16 2002 Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4B30E37B401 for ; Thu, 5 Dec 2002 21:35:15 -0800 (PST) Received: from rwcrmhc51.attbi.com (rwcrmhc51.attbi.com [204.127.198.38]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5F55243E9C for ; Thu, 5 Dec 2002 21:35:14 -0800 (PST) (envelope-from julian@elischer.org) Received: from InterJet.elischer.org (12-232-168-4.client.attbi.com[12.232.168.4]) by rwcrmhc51.attbi.com (rwcrmhc51) with ESMTP id <20021206053512051008cds5e>; Fri, 6 Dec 2002 05:35:12 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id VAA40912; Thu, 5 Dec 2002 21:34:22 -0800 (PST) Date: Thu, 5 Dec 2002 21:34:20 -0800 (PST) From: Julian Elischer To: Kirk McKusick Cc: Kris Kennaway , Robert Watson , fs@FreeBSD.ORG Subject: Re: panic: ffs_vfree: range: dev = ad4s1c, ino = -1690809896, fs = /mnt2 In-Reply-To: <200212060135.gB61Zk59092119@beastie.mckusick.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org This is one of the reasons that I think such fields should all be defined as unsigned to start with.. On Thu, 5 Dec 2002, Kirk McKusick wrote: > Well it is not at all clear how the dirpref routine came up with > such an out of whack inode preference (2604157400 when the filesystem > has only 3538944 inodes), but the following fix should catch it and > make it harmless. I have submitted the patch to release engineering. > > Kirk McKusick > > =-=-=-=-= > > Index: ffs_alloc.c > =================================================================== > RCS file: /usr/ncvs/src/sys/ufs/ffs/ffs_alloc.c,v > retrieving revision 1.102 > diff -c -r1.102 ffs_alloc.c > *** ffs_alloc.c 2002/09/19 03:55:30 1.102 > --- ffs_alloc.c 2002/12/06 01:15:50 > *************** > *** 841,847 **** > ipref = ffs_dirpref(pip); > else > ipref = pip->i_number; > ! if (ipref >= fs->fs_ncg * fs->fs_ipg) > ipref = 0; > cg = ino_to_cg(fs, ipref); > /* > --- 841,847 ---- > ipref = ffs_dirpref(pip); > else > ipref = pip->i_number; > ! if ((unsigned)ipref >= fs->fs_ncg * fs->fs_ipg) > ipref = 0; > cg = ino_to_cg(fs, ipref); > /* > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message