linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eryu Guan <guaneryu@gmail.com>
To: linux-btrfs@vger.kernel.org
Cc: Eryu Guan <guaneryu@gmail.com>
Subject: [PATCH 03/10] btrfs-progs: remove deadcode around metadump_v2 in check_chunk_refs
Date: Mon, 19 Oct 2015 19:37:53 +0800	[thread overview]
Message-ID: <1445254680-11102-4-git-send-email-guaneryu@gmail.com> (raw)
In-Reply-To: <1445254680-11102-1-git-send-email-guaneryu@gmail.com>

metadump_v2 is initialized to 0 and never updated again. So remove the
deadcode.

Signed-off-by: Eryu Guan <guaneryu@gmail.com>
---

I'm not sure about this one, seems metadump_v2 should be initialized depending
on whether superblock has BTRFS_SUPER_FLAG_METADUMP_V2 flag set.

 cmds-check.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/cmds-check.c b/cmds-check.c
index 80a7c29..118a274 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -7597,7 +7597,6 @@ static int check_chunk_refs(struct chunk_record *chunk_rec,
 	u64 devid;
 	u64 offset;
 	u64 length;
-	int metadump_v2 = 0;
 	int i;
 	int ret = 0;
 
@@ -7610,8 +7609,7 @@ static int check_chunk_refs(struct chunk_record *chunk_rec,
 					       cache);
 		if (chunk_rec->length != block_group_rec->offset ||
 		    chunk_rec->offset != block_group_rec->objectid ||
-		    (!metadump_v2 &&
-		     chunk_rec->type_flags != block_group_rec->flags)) {
+		    chunk_rec->type_flags != block_group_rec->flags) {
 			if (!silent)
 				fprintf(stderr,
 					"Chunk[%llu, %u, %llu]: length(%llu), offset(%llu), type(%llu) mismatch with block group[%llu, %u, %llu]: offset(%llu), objectid(%llu), flags(%llu)\n",
@@ -7645,9 +7643,6 @@ static int check_chunk_refs(struct chunk_record *chunk_rec,
 		ret = 1;
 	}
 
-	if (metadump_v2)
-		return ret;
-
 	length = calc_stripe_length(chunk_rec->type_flags, chunk_rec->length,
 				    chunk_rec->num_stripes);
 	for (i = 0; i < chunk_rec->num_stripes; ++i) {
-- 
2.4.3


  parent reply	other threads:[~2015-10-19 11:42 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-19 11:37 [PATCH 01/10] btrfs-progs: fix leak of "path" in btrfs_find_item() error paths Eryu Guan
2015-10-19 11:37 ` [PATCH 02/10] btrfs-progs: save and return error number correctly in check_chunks_and_extents Eryu Guan
2015-10-19 11:37 ` [PATCH 02/10] btrfs-progs: save " Eryu Guan
2015-10-19 13:41   ` David Sterba
2015-10-20 10:28     ` Eryu Guan
2015-10-21  9:26       ` David Sterba
2015-10-19 11:37 ` Eryu Guan [this message]
2015-10-19 13:45   ` [PATCH 03/10] btrfs-progs: remove deadcode around metadump_v2 in check_chunk_refs David Sterba
2015-10-19 11:37 ` [PATCH 04/10] btrfs-progs: return -EIO properly in restore_metadump() Eryu Guan
2015-10-19 13:56   ` David Sterba
2015-10-19 11:37 ` [PATCH 05/10] btrfs-progs: mute coverity warnings about deadcode Eryu Guan
2015-10-21 11:34   ` David Sterba
2015-10-19 11:37 ` [PATCH 06/10] btrfs-progs: vailidate pointer before dereferencing it in btrfs_cow_block() Eryu Guan
2015-10-19 13:47   ` David Sterba
2015-10-19 11:37 ` [PATCH 07/10] btrfs-progs: fix memory leak on error path Eryu Guan
2015-10-19 11:37 ` [PATCH 08/10] btrfs-progs: remove identical branch in record_extent() Eryu Guan
2015-10-19 11:37 ` [PATCH 09/10] btrfs-progs: fix memory leak in cmd_qgroup_show() Eryu Guan
2015-10-19 11:38 ` [PATCH 10/10] btrfs-progs: return -ENOMEM properly in btrfs_read_block_groups() Eryu Guan
2015-10-19 14:21 ` [PATCH 01/10] btrfs-progs: fix leak of "path" in btrfs_find_item() error paths David Sterba

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=1445254680-11102-4-git-send-email-guaneryu@gmail.com \
    --to=guaneryu@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    /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 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).