diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-09-05 16:09:51 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:07 -0400 |
commit | a1b32a5932cfac7c38b442582285f3da2a09dfd8 (patch) | |
tree | d468c51c7391ee1a0cfcc6ff1e76e11c01646efe /fs/btrfs/disk-io.c | |
parent | 95819c05732c511338b43c115ffbcee978c02888 (diff) |
Btrfs: Add debugging checks to track down corrupted metadata
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 6a218f792e59..8e7a938bfbc7 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -250,7 +250,7 @@ static int btree_read_extent_buffer_pages(struct btrfs_root *root, | |||
250 | if (!ret && | 250 | if (!ret && |
251 | !verify_parent_transid(io_tree, eb, parent_transid)) | 251 | !verify_parent_transid(io_tree, eb, parent_transid)) |
252 | return ret; | 252 | return ret; |
253 | 253 | printk("read extent buffer pages failed with ret %d mirror no %d\n", ret, mirror_num); | |
254 | num_copies = btrfs_num_copies(&root->fs_info->mapping_tree, | 254 | num_copies = btrfs_num_copies(&root->fs_info->mapping_tree, |
255 | eb->start, eb->len); | 255 | eb->start, eb->len); |
256 | if (num_copies == 1) | 256 | if (num_copies == 1) |
@@ -348,6 +348,9 @@ int btree_readpage_end_io_hook(struct page *page, u64 start, u64 end, | |||
348 | 348 | ||
349 | found_start = btrfs_header_bytenr(eb); | 349 | found_start = btrfs_header_bytenr(eb); |
350 | if (found_start != start) { | 350 | if (found_start != start) { |
351 | printk("bad tree block start %llu %llu\n", | ||
352 | (unsigned long long)found_start, | ||
353 | (unsigned long long)eb->start); | ||
351 | ret = -EIO; | 354 | ret = -EIO; |
352 | goto err; | 355 | goto err; |
353 | } | 356 | } |
@@ -709,6 +712,8 @@ struct extent_buffer *read_tree_block(struct btrfs_root *root, u64 bytenr, | |||
709 | 712 | ||
710 | if (ret == 0) { | 713 | if (ret == 0) { |
711 | buf->flags |= EXTENT_UPTODATE; | 714 | buf->flags |= EXTENT_UPTODATE; |
715 | } else { | ||
716 | WARN_ON(1); | ||
712 | } | 717 | } |
713 | return buf; | 718 | return buf; |
714 | 719 | ||