mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
Btrfs: make sure the chunk allocator doesn't create zero length chunks
A recent commit allowed for smaller chunks to be created, but didn't make sure they were always bigger than a stripe. After some divides, this led to zero length stripes. Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
parent
ab6e24103c
commit
9f680ce04e
1 changed files with 6 additions and 0 deletions
|
@ -2249,6 +2249,12 @@ again:
|
|||
if (!looped)
|
||||
calc_size = max_t(u64, min_stripe_size, calc_size);
|
||||
|
||||
/*
|
||||
* we're about to do_div by the stripe_len so lets make sure
|
||||
* we end up with something bigger than a stripe
|
||||
*/
|
||||
calc_size = max_t(u64, calc_size, stripe_len * 4);
|
||||
|
||||
do_div(calc_size, stripe_len);
|
||||
calc_size *= stripe_len;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue