diff options
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r-- | fs/btrfs/volumes.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index aa7dc36dac78..8db7b14bbae8 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -2250,6 +2250,12 @@ again: | |||
2250 | if (!looped) | 2250 | if (!looped) |
2251 | calc_size = max_t(u64, min_stripe_size, calc_size); | 2251 | calc_size = max_t(u64, min_stripe_size, calc_size); |
2252 | 2252 | ||
2253 | /* | ||
2254 | * we're about to do_div by the stripe_len so lets make sure | ||
2255 | * we end up with something bigger than a stripe | ||
2256 | */ | ||
2257 | calc_size = max_t(u64, calc_size, stripe_len * 4); | ||
2258 | |||
2253 | do_div(calc_size, stripe_len); | 2259 | do_div(calc_size, stripe_len); |
2254 | calc_size *= stripe_len; | 2260 | calc_size *= stripe_len; |
2255 | 2261 | ||