From owner-freebsd-fs@FreeBSD.ORG Fri Mar 11 19:31:18 2005 Return-Path: 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 67BD616A4CE for ; Fri, 11 Mar 2005 19:31:18 +0000 (GMT) Received: from duchess.speedfactory.net (duchess.speedfactory.net [66.23.201.84]) by mx1.FreeBSD.org (Postfix) with SMTP id D77ED43D49 for ; Fri, 11 Mar 2005 19:31:17 +0000 (GMT) (envelope-from ups@tree.com) Received: (qmail 32118 invoked by uid 89); 11 Mar 2005 19:31:17 -0000 Received: from duchess.speedfactory.net (66.23.201.84) by duchess.speedfactory.net with SMTP; 11 Mar 2005 19:31:17 -0000 Received: (qmail 32105 invoked by uid 89); 11 Mar 2005 19:31:16 -0000 Received: from unknown (HELO palm.tree.com) (66.23.216.49) by duchess.speedfactory.net with SMTP; 11 Mar 2005 19:31:16 -0000 Received: from [127.0.0.1] (localhost.tree.com [127.0.0.1]) by palm.tree.com (8.12.10/8.12.10) with ESMTP id j2BJVFw6067130; Fri, 11 Mar 2005 14:31:16 -0500 (EST) (envelope-from ups@tree.com) From: Stephan Uphoff To: Sam Leffler In-Reply-To: <4231D417.9060705@errno.com> References: <4231D417.9060705@errno.com> Content-Type: text/plain Message-Id: <1110569475.29804.23911.camel@palm> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Fri, 11 Mar 2005 14:31:15 -0500 Content-Transfer-Encoding: 7bit cc: fs@freebsd.org Subject: Re: dirhash potential bug X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Mar 2005 19:31:18 -0000 On Fri, 2005-03-11 at 12:23, Sam Leffler wrote: > Coverity's analysis tool claims there might be a null bp dereferenced in > ufsdirhash_lookup. Attached is a patch to add a KASSERT but it'd be > good for someone more familiar with the code to check if a change is > required. > > Sam In my opinion the change is not required. Not knowing how the tool works my guess is that the function pointer um_blkatoff used in UFS_BLKATOFF makes it impossible for the tool to prove that bp will always be non-zero at this point. Can you replace UFS_BLKATOFF(vp, (off_t)blkoff, NULL, &bp) with ffs_blkatoff(vp, (off_t)blkoff, NULL, &bp) and rerun the test? Stephan > > ______________________________________________________________________ > ==== //depot/projects/wifi/sys/ufs/ufs/ufs_dirhash.c#3 - /usr/sam/wifi/sys/ufs/ufs/ufs_dirhash.c ==== > @@ -420,6 +420,7 @@ > if (UFS_BLKATOFF(vp, (off_t)blkoff, NULL, &bp) != 0) > return (EJUSTRETURN); > } > + KASSERT(bp != NULL, ("no buf?")); > dp = (struct direct *)(bp->b_data + (offset & bmask)); > if (dp->d_reclen == 0 || dp->d_reclen > > DIRBLKSIZ - (offset & (DIRBLKSIZ - 1))) { > > > ______________________________________________________________________ > _______________________________________________ > freebsd-fs@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-fs > To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org"