* [PATCH] Btrfs: take overflow into account in reserving space
@ 2011-10-05 20:35 Josef Bacik
0 siblings, 0 replies; only message in thread
From: Josef Bacik @ 2011-10-05 20:35 UTC (permalink / raw)
To: linux-btrfs
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>
---
fs/btrfs/extent-tree.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index f9711a8..f95e550 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -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;
}
--
1.7.5.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-10-05 20:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-05 20:35 [PATCH] Btrfs: take overflow into account in reserving space Josef Bacik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).