All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@gmail.com>
To: chris.mason@oracle.com
Cc: zheng.yan@oracle.com, linux-btrfs@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>
Subject: BTRFS: unreachable code found
Date: Fri, 13 Nov 2009 11:32:59 +0100	[thread overview]
Message-ID: <4AFD35DB.6050604@gmail.com> (raw)

Hi,

Stanse found unreachable code in btrfs_insert_some_items below (don't
look at the line numbers, they are on preprocessed code). I would fix
that if I knew how.

Should the assignment be after the if, before the break or nowhere?

 3068|int btrfs_insert_some_items(struct btrfs_trans_handle *trans,
 3069|       struct btrfs_root *root,
 3070|       struct btrfs_path *path,
 3071|       struct btrfs_key *cpu_key, u32 *data_size,
 3072|       int nr)
 3073|{
...
 3086| for (i = 0; i < nr; i++) {
 3087|  if (total_size + data_size[i] + sizeof(struct btrfs_item) >
 3088|      (((root->leafsize) - sizeof(struct btrfs_header)))) {
 3089|   break;
 3090|   nr = i;
     |This node is unreachable prev next
 3091|  }
 3092|  total_data += data_size[i];
 3093|  total_size += data_size[i] + sizeof(struct btrfs_item);
 3094| }

regards,
-- 
js
Faculty of Informatics, Masaryk University
Suse Labs, Novell

             reply	other threads:[~2009-11-13 10:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-13 10:32 Jiri Slaby [this message]
2009-11-13 21:36 ` BTRFS: unreachable code found Chris Mason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AFD35DB.6050604@gmail.com \
    --to=jirislaby@gmail.com \
    --cc=chris.mason@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zheng.yan@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.