From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 4 08:47:00 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4CD2016A4BF for ; Thu, 4 Sep 2003 08:47:00 -0700 (PDT) Received: from pimout2-ext.prodigy.net (pimout2-ext.prodigy.net [207.115.63.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id F11DC43FF9 for ; Thu, 4 Sep 2003 08:46:58 -0700 (PDT) (envelope-from bob@immure.com) Received: from maul.immure.com (adsl-66-136-206-1.dsl.austtx.swbell.net [66.136.206.1])h84FkvJ8106010 for ; Thu, 4 Sep 2003 11:46:58 -0400 Received: (from root@localhost) by maul.immure.com (8.12.9/8.12.9) id h84FkvSa063999 for freebsd-hackers@freebsd.org; Thu, 4 Sep 2003 10:46:57 -0500 (CDT) (envelope-from bob@immure.com) Received: from luke.immure.com (luke.immure.com [10.1.132.3]) by maul.immure.com (8.12.9/8.12.3) with ESMTP id h84Fkurs063974 for ; Thu, 4 Sep 2003 10:46:56 -0500 (CDT) (envelope-from bob@immure.com) Received: from luke.immure.com (localhost [127.0.0.1]) by luke.immure.com (8.12.9/8.12.9) with ESMTP id h84FkuVf079115 for ; Thu, 4 Sep 2003 10:46:56 -0500 (CDT) (envelope-from bob@luke.immure.com) Received: (from bob@localhost) by luke.immure.com (8.12.9/8.12.9/Submit) id h84FkuEN079114 for freebsd-hackers@freebsd.org; Thu, 4 Sep 2003 10:46:56 -0500 (CDT) Date: Thu, 4 Sep 2003 10:46:56 -0500 From: Bob Willcox To: hackers list Message-ID: <20030904154656.GA77746@luke.immure.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.4i X-scanner: scanned by Inflex 1.0.12.3 on maul.immure.com Subject: getblk() may return NULL, but most caller's don't check for it X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Bob Willcox List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2003 15:47:00 -0000 Hi All, While perusing the FreeBSD kernel source code today I noticed that there are several reasons that the getblk() function in vfs_bio.c might decide to return a NULL return code. However, checking both 4-stable and 5-current I can find only place (in 5-curren) where the return value from getblk() is actually checked for the possibility of being NULL (in function cluster_rbuild() in vfs_cluster.c near line 389). In all other instances that I can find the returned value is quickly dereferenced w/o any check. What am I missing here? Is this really a bug, or are there extenuating circumstances that prevent getblk() from returning NULL in actual operation? Thanks for any insight that you may provide. Bob -- Bob Willcox Maslow's Maxim: bob@immure.com If the only tool you have is a hammer, Austin, TX you treat everything like a nail.