@@ -459,15 +459,6 @@ static int verify_level_key(struct btrfs_fs_info *fs_info,
if (!first_key)
return 0;
- /* We have @first_key, so this @eb must have at least one item */
- if (btrfs_header_nritems(eb) == 0) {
- btrfs_err(fs_info,
- "invalid tree nritems, bytenr=%llu nritems=0 expect >0",
- eb->start);
- WARN_ON(IS_ENABLED(CONFIG_BTRFS_DEBUG));
- return -EUCLEAN;
- }
-
if (found_level)
btrfs_node_key_to_cpu(eb, &found_key, 0);
else
@@ -1354,13 +1354,6 @@ static int check_leaf(struct extent_buffer *leaf, bool check_item_data)
owner);
return -EUCLEAN;
}
- /* Unknown tree */
- if (owner == 0) {
- generic_err(leaf, 0,
- "invalid owner, root 0 is not defined");
- return -EUCLEAN;
- }
-
key.objectid = owner;
key.type = BTRFS_ROOT_ITEM_KEY;
key.offset = (u64)-1;
BugLink: https://bugs.launchpad.net/bugs/1934709 This reverts commit 4ee43ff1826c2ebc84c569750b7a0977a625c970. A mistake was made in the backport of the below commit: ubuntu-bionic 50ab1ff51db0c5eb77ffc6f15ef32f07764f86ff Author: Qu Wenruo <wqu@suse.com> Date: Thu Mar 29 09:08:11 2018 +0800 Subject: btrfs: Validate child tree block's level and first key Link: https://paste.ubuntu.com/p/DQjTkfNRDt/ This commit is applied ontop of the problematic commit, making it a dependency for revert. We will revert this commit, and re-apply it after the corrected "btrfs: Validate child tree block's level and first key" has been applied. Signed-off-by: Matthew Ruffell <matthew.ruffell@canonical.com> --- fs/btrfs/disk-io.c | 9 --------- fs/btrfs/tree-checker.c | 7 ------- 2 files changed, 16 deletions(-)