diff options
author | Chris Mason <chris.mason@oracle.com> | 2012-02-21 21:20:54 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2012-02-22 10:59:55 -0500 |
commit | e22827e9bb9634540d32bf29b23b26989e384902 (patch) | |
tree | bb51c2126f2779bd9209a6397b2d78ba19b6e2f9 /ctree.c | |
parent | 8f01235dd8cf65c064f1b979d24a989ca296ea33 (diff) | |
download | btrfs-progs-e22827e9bb9634540d32bf29b23b26989e384902.tar.gz |
btrfsck: add early code to handle corrupted block groups
This is mostly disabled, but it is step one in handling
corrupted block groups in the extent allocation tree.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'ctree.c')
-rw-r--r-- | ctree.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -151,8 +151,10 @@ int btrfs_fsck_reinit_root(struct btrfs_trans_handle *trans, btrfs_level_size(root, 0), root->root_key.objectid, &disk_key, level, 0, 0); - if (IS_ERR(c)) - return PTR_ERR(c); + if (IS_ERR(c)) { + c = old; + extent_buffer_get(c); + } memset_extent_buffer(c, 0, 0, sizeof(struct btrfs_header)); btrfs_set_header_level(c, level); @@ -1262,6 +1264,8 @@ again: key->objectid); b = read_node_slot(root, b, slot); + if (!extent_buffer_uptodate(b)) + return -EIO; } else { p->slots[level] = slot; if (ins_len > 0 && |