diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index a86c049932f9..15cdc67ce9ad 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c @@ -1628,6 +1628,10 @@ static int lookup_dir_item_inode(struct btrfs_root *root, goto out; } btrfs_dir_item_key_to_cpu(path->nodes[0], di, &key); + if (key.type == BTRFS_ROOT_ITEM_KEY) { + ret = -ENOENT; + goto out; + } *found_inode = key.objectid; *found_type = btrfs_dir_type(path->nodes[0], di);