On Wed, Mar 21, 2012 at 09:11:37PM -0400, Jeff Mahoney wrote:
> --- a/fs/btrfs/extent-tree.c
> +++ b/fs/btrfs/extent-tree.c
> @@ -250,10 +250,17 @@ static int exclude_super_stripes(struct btrfs_root 
> *root,
>  
>       for (i = 0; i < BTRFS_SUPER_MIRROR_MAX; i++) {
>               bytenr = btrfs_sb_offset(i);
> +             if (bytenr <= cache->key.objectid + cache->key.offset)
> +                     break;

The condition is wrong. Exclude superblock if it's inside the block
group:

             if (cache->key.objectid + cache->key.offset <= bytenr)
                     break;
             if (bytenr < cache->key.objectid)
                     continue;

break if the remaining sb's are too far and skip to next one otherwise.

> +             logical = NULL;
>               ret = btrfs_rmap_block(&root->fs_info->mapping_tree,
>                                      cache->key.objectid, bytenr,
>                                      0, &logical, &nr, &stripe_len);
> -             BUG_ON(ret); /* -ENOMEM */
> +             if (ret < 0) {
> +                     kfree(logical);
> +                     free_excluded_extents(root, cache);
> +                     goto out;
> +             }
>  
>               while (nr--) {
>                       cache->bytes_super += stripe_len;
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to