From mboxrd@z Thu Jan 1 00:00:00 1970 From: Muli Ben-Yehuda Subject: Re: Is a NULL check missing in nfs_lookup? Date: Fri, 5 Jan 2007 21:41:00 +0200 Message-ID: <20070105194100.GQ3584@rhun.ibm.com> References: <1167999770.6050.39.camel@lade.trondhjem.org> <200701051910.l05JA6iq011061@agora.fsl.cs.sunysb.edu> <20070105192304.GH24620@parisc-linux.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Erez Zadok , Trond Myklebust , Chaitanya Patti , linux-fsdevel@vger.kernel.org Return-path: Received: from mtagate3.uk.ibm.com ([195.212.29.136]:33952 "EHLO mtagate3.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422701AbXAETlF (ORCPT ); Fri, 5 Jan 2007 14:41:05 -0500 Received: from d06nrmr1407.portsmouth.uk.ibm.com (d06nrmr1407.portsmouth.uk.ibm.com [9.149.38.185]) by mtagate3.uk.ibm.com (8.13.8/8.13.8) with ESMTP id l05Jf20a158816 for ; Fri, 5 Jan 2007 19:41:02 GMT Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1407.portsmouth.uk.ibm.com (8.13.6/8.13.6/NCO v8.1.1) with ESMTP id l05Jf2Dk1884354 for ; Fri, 5 Jan 2007 19:41:02 GMT Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l05Jf16V009947 for ; Fri, 5 Jan 2007 19:41:02 GMT To: Matthew Wilcox Content-Disposition: inline In-Reply-To: <20070105192304.GH24620@parisc-linux.org> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Fri, Jan 05, 2007 at 12:23:04PM -0700, Matthew Wilcox wrote: > On Fri, Jan 05, 2007 at 02:10:06PM -0500, Erez Zadok wrote: > > Ah, ok. So why not put an ASSERT in there, or at least a comment, to make > > the code clearer. As it stands, anyone looking at the code in the future > > can easily rediscover this "bug" that dereferences a null ptr. > > Because anyone poking in the VFS should take the time to understand > how it works? Adding crap like BUG_ON(!nd) is pointless -- you don't > get a clearer backtrace from that than you do from a null pointer. Except that a BUG_ON makes the author's intent clear and a NULL pointer deref doesn't. Sure, anyone poking around in the VFS should understand how it works. That doesn't mean whoever poked there before can't leave trail marks. Cheers, Muli