public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] unreached code in ctree.c
@ 2009-03-27 10:33 Dan Carpenter
  2009-03-27 12:47 ` Chris Mason
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2009-03-27 10:33 UTC (permalink / raw)
  To: chris.mason; +Cc: linux-btrfs

Smatch (http://repo.or.cz/w/smatch.git/) complains about this unreachable 
code so I moved the break; up a line.  Compile tested.

regards,
dan carpenter

Signed-off-by: Dan Carpenter <error27@gmail.com>

--- orig/fs/btrfs/ctree.c	2009-03-27 07:31:42.000000000 +0300
+++ devel/fs/btrfs/ctree.c	2009-03-27 07:32:26.000000000 +0300
@@ -3318,8 +3318,8 @@
 	for (i = 0; i < nr; i++) {
 		if (total_size + data_size[i] + sizeof(struct btrfs_item) >
 		    BTRFS_LEAF_DATA_SIZE(root)) {
-			break;
 			nr = i;
+			break;
 		}
 		total_data += data_size[i];
 		total_size += data_size[i] + sizeof(struct btrfs_item);

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

* Re: [patch] unreached code in ctree.c
  2009-03-27 10:33 [patch] unreached code in ctree.c Dan Carpenter
@ 2009-03-27 12:47 ` Chris Mason
  0 siblings, 0 replies; 2+ messages in thread
From: Chris Mason @ 2009-03-27 12:47 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: linux-btrfs

On Fri, 2009-03-27 at 13:33 +0300, Dan Carpenter wrote:
> Smatch (http://repo.or.cz/w/smatch.git/) complains about this unreachable 
> code so I moved the break; up a line.  Compile tested.
> 
> regards,
> dan carpenter
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> 
> --- orig/fs/btrfs/ctree.c	2009-03-27 07:31:42.000000000 +0300
> +++ devel/fs/btrfs/ctree.c	2009-03-27 07:32:26.000000000 +0300
> @@ -3318,8 +3318,8 @@
>  	for (i = 0; i < nr; i++) {
>  		if (total_size + data_size[i] + sizeof(struct btrfs_item) >
>  		    BTRFS_LEAF_DATA_SIZE(root)) {
> -			break;
>  			nr = i;
> +			break;
>  		}

Whoops, that's not good.  This whole function is actually unused after
the changes in the experimental tree.

-chris



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

end of thread, other threads:[~2009-03-27 12:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-27 10:33 [patch] unreached code in ctree.c Dan Carpenter
2009-03-27 12:47 ` Chris Mason

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox