Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 299807
b: refs/heads/master
c: 37db63a
h: refs/heads/master
i:
  299805: 0cefa04
  299803: de2a758
  299799: fb9388b
  299791: 19c245d
  299775: 02d47f1
v: v3
  • Loading branch information
Ilya Dryomov authored and David Sterba committed Apr 18, 2012
1 parent 69228a0 commit 6a648ce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b916a59adfdc875381b68ced258694b434cf43ae
refs/heads/master: 37db63a400d3bac467795aa43901065fd8d903b7
6 changes: 4 additions & 2 deletions trunk/fs/btrfs/volumes.c
Original file line number Diff line number Diff line change
Expand Up @@ -3324,12 +3324,14 @@ static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
stripe_size = devices_info[ndevs-1].max_avail;
num_stripes = ndevs * dev_stripes;

if (stripe_size * num_stripes > max_chunk_size * ncopies) {
if (stripe_size * ndevs > max_chunk_size * ncopies) {
stripe_size = max_chunk_size * ncopies;
do_div(stripe_size, num_stripes);
do_div(stripe_size, ndevs);
}

do_div(stripe_size, dev_stripes);

/* align to BTRFS_STRIPE_LEN */
do_div(stripe_size, BTRFS_STRIPE_LEN);
stripe_size *= BTRFS_STRIPE_LEN;

Expand Down

0 comments on commit 6a648ce

Please sign in to comment.