|
@@ -572,13 +572,17 @@ static noinline int check_leaf(struct btrfs_root *root,
|
|
|
* open_ctree() some roots has not yet been set up.
|
|
|
*/
|
|
|
if (!IS_ERR_OR_NULL(check_root)) {
|
|
|
+ struct extent_buffer *eb;
|
|
|
+
|
|
|
+ eb = btrfs_root_node(check_root);
|
|
|
/* if leaf is the root, then it's fine */
|
|
|
- if (leaf->start !=
|
|
|
- btrfs_root_bytenr(&check_root->root_item)) {
|
|
|
+ if (leaf != eb) {
|
|
|
CORRUPT("non-root leaf's nritems is 0",
|
|
|
- leaf, root, 0);
|
|
|
+ leaf, check_root, 0);
|
|
|
+ free_extent_buffer(eb);
|
|
|
return -EIO;
|
|
|
}
|
|
|
+ free_extent_buffer(eb);
|
|
|
}
|
|
|
return 0;
|
|
|
}
|