aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJosef Bacik <josef@redhat.com>2011-10-05 16:35:28 -0400
committerJosef Bacik <josef@redhat.com>2011-10-19 15:12:53 -0400
commit9a82ca659d8bfd99afc0e89bbde2202322df5755 (patch)
tree965b34fb6e1133d3a198954aa1d97ede017f993a /fs
parent549b4fdb8f3c0708bbc0ee12ff955cd206c0f60c (diff)
Btrfs: take overflow into account in reserving space
My overcommit stuff can be a little racy when we're filling up the disk with fs_mark and we overcommit into things that quickly get used up for data. So use num_bytes to see if we have enough available space so we're less likely to overcommit ourselves out of the ability to make reservations. Thanks, Signed-off-by: Josef Bacik <josef@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/extent-tree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index f9711a82fc54..f95e55083bdb 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -3521,7 +3521,7 @@ again:
3521 avail >>= 1; 3521 avail >>= 1;
3522 spin_unlock(&root->fs_info->free_chunk_lock); 3522 spin_unlock(&root->fs_info->free_chunk_lock);
3523 3523
3524 if (used + orig_bytes < space_info->total_bytes + avail) { 3524 if (used + num_bytes < space_info->total_bytes + avail) {
3525 space_info->bytes_may_use += orig_bytes; 3525 space_info->bytes_may_use += orig_bytes;
3526 ret = 0; 3526 ret = 0;
3527 } 3527 }