提交 9a82ca65 编写于 作者: J Josef Bacik

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: NJosef Bacik <josef@redhat.com>
上级 549b4fdb
......@@ -3521,7 +3521,7 @@ static int reserve_metadata_bytes(struct btrfs_root *root,
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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册