Skip to contentSkip to conversation

Btrfs: take overflow into account in reserving space

PATCH New Josef Bacik 1 participant 1 message Oct 5, 2011 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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,

---
 fs/btrfs/extent-tree.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/btrfs/extent-tree.c +1 -1
index f9711a8..f95e550 100644
@@ -3521,7 +3521,7 @@ again:
 			avail >>= 1;
 		 spin_unlock(&root->fs_info->free_chunk_lock);
 
-		if (used + orig_bytes < space_info->total_bytes + avail) {
+		if (used + num_bytes < space_info->total_bytes + avail) {
 			space_info->bytes_may_use += orig_bytes;
 			ret = 0;
 		}
Signature · 1 line
1.7.5.2