]> git.hungrycats.org Git - linux/commitdiff
Revert "Btrfs: remove BUG_ON()'s in btrfs_map_block"
authorZygo Blaxell <zblaxell@thirteen.furryterror.org>
Mon, 13 Jun 2016 20:35:32 +0000 (16:35 -0400)
committerZygo Blaxell <zblaxell@thirteen.furryterror.org>
Mon, 13 Jun 2016 20:35:32 +0000 (16:35 -0400)
This reverts commit 16bf591e70022a2561138f8a562d17a24b1478f3.

fs/btrfs/volumes.c

index 2daafaba36351adfc390007ef4d0d75295deb271..366b335946fae763e380ed884792df5efe07a2c9 100644 (file)
@@ -5277,18 +5277,7 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int rw,
        stripe_nr = div64_u64(stripe_nr, stripe_len);
 
        stripe_offset = stripe_nr * stripe_len;
-       if (offset < stripe_offset) {
-               btrfs_crit(fs_info, "stripe math has gone wrong, "
-                          "stripe_offset=%llu, offset=%llu, start=%llu, "
-                          "logical=%llu, stripe_len=%llu\n",
-                          (unsigned long long)stripe_offset,
-                          (unsigned long long)offset,
-                          (unsigned long long)em->start,
-                          (unsigned long long)logical,
-                          (unsigned long long)stripe_len);
-               free_extent_map(em);
-               return -EINVAL;
-       }
+       BUG_ON(offset < stripe_offset);
 
        /* stripe_offset is the offset of this block in its stripe*/
        stripe_offset = offset - stripe_offset;
@@ -5527,14 +5516,7 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int rw,
                                &stripe_index);
                mirror_num = stripe_index + 1;
        }
-       if (stripe_index >= map->num_stripes) {
-               btrfs_crit(fs_info, "stripe index math went horribly wrong, "
-                          "got stripe_index=%lu, num_stripes=%lu\n",
-                          (unsigned long)stripe_index,
-                          (unsigned long)map->num_stripes);
-               ret = -EINVAL;
-               goto out;
-       }
+       BUG_ON(stripe_index >= map->num_stripes);
 
        num_alloc_stripes = num_stripes;
        if (dev_replace_is_ongoing) {