diff mbox

btrfs-progs: corrupt-block: Add support to corrupt extent for skinny metadata

Message ID 1464230162-7657-1-git-send-email-quwenruo@cn.fujitsu.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Qu Wenruo May 26, 2016, 2:36 a.m. UTC
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(+)

Comments

David Sterba June 1, 2016, 1:57 p.m. UTC | #1
On Thu, May 26, 2016 at 10:36:02AM +0800, Qu Wenruo wrote:
> 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>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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 &&