aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/volumes.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-04-12 21:37:04 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-04-12 21:37:04 -0400
commitd6cf853d4d73c268fc8920ac4e812ee26a12847c (patch)
treec909145638eb5c4897ea7e424759eb9b564ebe18 /fs/btrfs/volumes.c
parent6a945f38be5f2c198853069a336c887a51d1a238 (diff)
parent9f680ce04ea19dabbbafe01b57b61930a9b70741 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable
* 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable: Btrfs: make sure the chunk allocator doesn't create zero length chunks Btrfs: fix data enospc check overflow
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r--fs/btrfs/volumes.c6
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