Re: Is a NULL check missing in nfs_lookup?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In message <20070105192304.GH24620@xxxxxxxxxxxxxxxx>, Matthew Wilcox writes:
> 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.

Then stick a /* comment */ telling anyone who looks at the code what was the
author's intentions, esp. for such an obvious null/uninitialized pointer
deref.

Source code should be as clear as possible, regardless of the expertise of
its author or any reader.  If you keep this code as is, the bug will get
re-discovered and re-reported time and again, wasting everyone's time.

Erez.
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux