All of lore.kernel.org
 help / color / mirror / Atom feed
* re: rbd: enforce parent overlap
@ 2013-04-30  7:24 Dan Carpenter
  2013-04-30 11:57 ` Alex Elder
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2013-04-30  7:24 UTC (permalink / raw)
  To: elder; +Cc: ceph-devel

Hello Alex Elder,

This is a semi-automatic email about new static checker warnings.

The patch 64548e0638af: "rbd: enforce parent overlap" from Apr 21,
2013, leads to the following Smatch complaint:

drivers/block/rbd.c:1449 rbd_osd_read_callback()
	 error: we previously assumed 'img_request' could be null (see line 1448)

drivers/block/rbd.c
  1447			img_request = obj_request->img_request;
  1448			layered = img_request && img_request_layered_test(img_request);
                                  ^^^^^^^^^^^
Old check.
  1449			rbd_dev = img_request->rbd_dev;
                                  ^^^^^^^^^^^^^^^^^^^^
New dereference.

  1450		}
  1451	

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: rbd: enforce parent overlap
  2013-04-30  7:24 rbd: enforce parent overlap Dan Carpenter
@ 2013-04-30 11:57 ` Alex Elder
  2013-04-30 13:20   ` Dan Carpenter
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Elder @ 2013-04-30 11:57 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: ceph-devel

On 04/30/2013 02:24 AM, Dan Carpenter wrote:
> Hello Alex Elder,
> 
> This is a semi-automatic email about new static checker warnings.

Cool, I've never used smatch before.  Great to get these
automated warnings.

I looked at this, and this is not a problem.  An earlier
commit, about 10 before that one:
    rbd: always check IMG_DATA flag
implements a comparable check.  Any rbd object request
with the IMG_DATA flag set (obj_request_img_data_test()
returns true) will have a non-null image_request pointer.

I suppose I should have asserted it was non-null, I do
that all over the place...

					-Alex

> The patch 64548e0638af: "rbd: enforce parent overlap" from Apr 21,
> 2013, leads to the following Smatch complaint:
> 
> drivers/block/rbd.c:1449 rbd_osd_read_callback()
> 	 error: we previously assumed 'img_request' could be null (see line 1448)
> 
> drivers/block/rbd.c
>   1447			img_request = obj_request->img_request;
>   1448			layered = img_request && img_request_layered_test(img_request);
>                                   ^^^^^^^^^^^
> Old check.
>   1449			rbd_dev = img_request->rbd_dev;
>                                   ^^^^^^^^^^^^^^^^^^^^
> New dereference.
> 
>   1450		}
>   1451	
> 
> regards,
> dan carpenter
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: rbd: enforce parent overlap
  2013-04-30 11:57 ` Alex Elder
@ 2013-04-30 13:20   ` Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2013-04-30 13:20 UTC (permalink / raw)
  To: Alex Elder; +Cc: ceph-devel

On Tue, Apr 30, 2013 at 06:57:14AM -0500, Alex Elder wrote:
> On 04/30/2013 02:24 AM, Dan Carpenter wrote:
> > Hello Alex Elder,
> > 
> > This is a semi-automatic email about new static checker warnings.
> 
> Cool, I've never used smatch before.  Great to get these
> automated warnings.
> 
> I looked at this, and this is not a problem.  An earlier
> commit, about 10 before that one:
>     rbd: always check IMG_DATA flag
> implements a comparable check.  Any rbd object request
> with the IMG_DATA flag set (obj_request_img_data_test()
> returns true) will have a non-null image_request pointer.
> 
> I suppose I should have asserted it was non-null, I do
> that all over the place...

If Smatch knows a variable is never NULL then it ignores
inconsistent NULL checking but it would be better to just remove the
unneeded check.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-04-30 13:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-30  7:24 rbd: enforce parent overlap Dan Carpenter
2013-04-30 11:57 ` Alex Elder
2013-04-30 13:20   ` Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.