All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo@cn.fujitsu.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH] btrfs-progs: corrupt-block: Add support to corrupt extent for skinny metadata
Date: Thu, 26 May 2016 10:36:02 +0800	[thread overview]
Message-ID: <1464230162-7657-1-git-send-email-quwenruo@cn.fujitsu.com> (raw)

For skinny metadata case, btrfs-corrupt-block can't corrupt a metadata
extent due to the type judgment doesn't include BTRFS_METADATA_ITEM_KEY.

Fix it.

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
---
 btrfs-corrupt-block.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/btrfs-corrupt-block.c b/btrfs-corrupt-block.c
index 2cc9704..020afab 100644
--- a/btrfs-corrupt-block.c
+++ b/btrfs-corrupt-block.c
@@ -210,6 +210,7 @@ static int corrupt_extent(struct btrfs_trans_handle *trans,
 			break;
 
 		if (key.type != BTRFS_EXTENT_ITEM_KEY &&
+		    key.type != BTRFS_METADATA_ITEM_KEY &&
 		    key.type != BTRFS_TREE_BLOCK_REF_KEY &&
 		    key.type != BTRFS_EXTENT_DATA_REF_KEY &&
 		    key.type != BTRFS_EXTENT_REF_V0_KEY &&
-- 
2.8.2




             reply	other threads:[~2016-05-26  2:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-26  2:36 Qu Wenruo [this message]
2016-06-01 13:57 ` [PATCH] btrfs-progs: corrupt-block: Add support to corrupt extent for skinny metadata 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=1464230162-7657-1-git-send-email-quwenruo@cn.fujitsu.com \
    --to=quwenruo@cn.fujitsu.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 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.