diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index f8e1d5b2c512..87eaf5dd2d5d 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c @@ -2213,6 +2213,9 @@ int extent_from_logical(struct btrfs_fs_info *fs_info, u64 logical, key.objectid = logical; key.offset = (u64)-1; + if (!extent_root) + return -ENOENT; + ret = btrfs_search_slot(NULL, extent_root, &key, path, 0, 0); if (ret < 0) return ret;