diff options
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r-- | fs/btrfs/volumes.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index a79b3cc09e94..825364fae690 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -2594,12 +2594,15 @@ int btrfs_rmap_block(struct btrfs_mapping_tree *map_tree, | |||
2594 | stripe_nr = stripe_nr * map->num_stripes + i; | 2594 | stripe_nr = stripe_nr * map->num_stripes + i; |
2595 | } | 2595 | } |
2596 | bytenr = chunk_start + stripe_nr * map->stripe_len; | 2596 | bytenr = chunk_start + stripe_nr * map->stripe_len; |
2597 | WARN_ON(nr >= map->num_stripes); | ||
2597 | for (j = 0; j < nr; j++) { | 2598 | for (j = 0; j < nr; j++) { |
2598 | if (buf[j] == bytenr) | 2599 | if (buf[j] == bytenr) |
2599 | break; | 2600 | break; |
2600 | } | 2601 | } |
2601 | if (j == nr) | 2602 | if (j == nr) { |
2603 | WARN_ON(nr >= map->num_stripes); | ||
2602 | buf[nr++] = bytenr; | 2604 | buf[nr++] = bytenr; |
2605 | } | ||
2603 | } | 2606 | } |
2604 | 2607 | ||
2605 | for (i = 0; i > nr; i++) { | 2608 | for (i = 0; i > nr; i++) { |