linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* re: Btrfs: cleanup destroy_marked_extents
@ 2013-05-09 12:22 Dan Carpenter
  2013-05-09 12:32 ` Josef Bacik
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2013-05-09 12:22 UTC (permalink / raw)
  To: jbacik; +Cc: linux-btrfs

Hello Josef Bacik,

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

The patch fd8b2b611580: "Btrfs: cleanup destroy_marked_extents" from 
Apr 24, 2013, leads to the following Smatch complaint:

fs/btrfs/disk-io.c:3814 btrfs_destroy_marked_extents()
	 warn: variable dereferenced before check 'eb' (see line 3813)

fs/btrfs/disk-io.c
  3812							   root->leafsize);
  3813				start += eb->len;
                                         ^^^^^^^
New dereference.
  3814				if (!eb)
                                    ^^^
New check.  Maybe we should be adding "root->leafsize" here?  Just
the check earlier would cause a forever loop.

  3815					continue;
  3816				wait_on_extent_buffer_writeback(eb);

regards,
dan carpenter

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

* Re: Btrfs: cleanup destroy_marked_extents
  2013-05-09 12:22 Btrfs: cleanup destroy_marked_extents Dan Carpenter
@ 2013-05-09 12:32 ` Josef Bacik
  0 siblings, 0 replies; 2+ messages in thread
From: Josef Bacik @ 2013-05-09 12:32 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Josef Bacik, linux-btrfs@vger.kernel.org

On Thu, May 09, 2013 at 06:22:06AM -0600, Dan Carpenter wrote:
> Hello Josef Bacik,
> 
> This is a semi-automatic email about new static checker warnings.
> 
> The patch fd8b2b611580: "Btrfs: cleanup destroy_marked_extents" from 
> Apr 24, 2013, leads to the following Smatch complaint:
> 
> fs/btrfs/disk-io.c:3814 btrfs_destroy_marked_extents()
> 	 warn: variable dereferenced before check 'eb' (see line 3813)
> 
> fs/btrfs/disk-io.c
>   3812							   root->leafsize);
>   3813				start += eb->len;
>                                          ^^^^^^^
> New dereference.
>   3814				if (!eb)
>                                     ^^^
> New check.  Maybe we should be adding "root->leafsize" here?  Just
> the check earlier would cause a forever loop.
> 
>   3815					continue;
>   3816				wait_on_extent_buffer_writeback(eb);
> 

Yeah I sent a patch for it yesterday, just me being an idiot, nothing to see
here,

Josef

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

end of thread, other threads:[~2013-05-09 12:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-09 12:22 Btrfs: cleanup destroy_marked_extents Dan Carpenter
2013-05-09 12:32 ` Josef Bacik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).