Skip to contentSkip to conversation

question about fs/ceph/snap.c

DISCUSSION Julia Lawall 2 participants 2 messages Nov 21, 2009

lore
Share & tools
lore
#0 lore raw

The file fs/ceph/snap.c contains four calls to ceph_lookup_snap_realm, all of which test the returned value first with IS_ERR and then by checking for a NULL pointer. But the definition of ceph_lookup_snap_realm contains a dereference of its argument if it is not NULL, which suggests that an ERR_PTR value is not what expected. So something seems to be inconsistent here.

julia

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july

#1 lore raw
Quoted 6 lines · Julia Lawall

The file fs/ceph/snap.c contains four calls to ceph_lookup_snap_realm, all of which test the returned value first with IS_ERR and then by checking for a NULL pointer. But the definition of ceph_lookup_snap_realm contains a dereference of its argument if it is not NULL, which suggests that an ERR_PTR value is not what expected. So something seems to be inconsistent here.

Yeah, I'm not sure how it ended up that way. I'll just remove the IS_ERR() checks, since there are no errors the lookup can return (besides not found).

The other patches look good; applying them now. Thank you! Coccinelle is pretty slick. :)

sage

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july