diff options
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r-- | fs/btrfs/volumes.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 3b984173d25b..1411b99555a4 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -3807,10 +3807,11 @@ static int __btrfs_map_block(struct btrfs_mapping_tree *map_tree, int rw, | |||
3807 | else if (mirror_num) | 3807 | else if (mirror_num) |
3808 | stripe_index += mirror_num - 1; | 3808 | stripe_index += mirror_num - 1; |
3809 | else { | 3809 | else { |
3810 | int old_stripe_index = stripe_index; | ||
3810 | stripe_index = find_live_mirror(map, stripe_index, | 3811 | stripe_index = find_live_mirror(map, stripe_index, |
3811 | map->sub_stripes, stripe_index + | 3812 | map->sub_stripes, stripe_index + |
3812 | current->pid % map->sub_stripes); | 3813 | current->pid % map->sub_stripes); |
3813 | mirror_num = stripe_index + 1; | 3814 | mirror_num = stripe_index - old_stripe_index + 1; |
3814 | } | 3815 | } |
3815 | } else { | 3816 | } else { |
3816 | /* | 3817 | /* |