diff options
Diffstat (limited to 'fs/btrfs')
-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 9bf1f581b872..b584e9a2add2 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -2249,6 +2249,12 @@ again: | |||
2249 | if (!looped) | 2249 | if (!looped) |
2250 | calc_size = max_t(u64, min_stripe_size, calc_size); | 2250 | calc_size = max_t(u64, min_stripe_size, calc_size); |
2251 | 2251 | ||
2252 | /* | ||
2253 | * we're about to do_div by the stripe_len so lets make sure | ||
2254 | * we end up with something bigger than a stripe | ||
2255 | */ | ||
2256 | calc_size = max_t(u64, calc_size, stripe_len * 4); | ||
2257 | |||
2252 | do_div(calc_size, stripe_len); | 2258 | do_div(calc_size, stripe_len); |
2253 | calc_size *= stripe_len; | 2259 | calc_size *= stripe_len; |
2254 | 2260 | ||