Browse files

Btrfs: limit the global reserve to 512mb

commit fdf30d1 upstream.

A user reported a problem where he was getting early ENOSPC with hundreds of
gigs of free data space and 6 gigs of free metadata space.  This is because the
global block reserve was taking up the entire free metadata space.  This is
ridiculous, we have infrastructure in place to throttle if we start using too
much of the global reserve, so instead of letting it get this huge just limit it
to 512mb so that users can still get work done.  This allowed the user to
complete his rsync without issues.  Thanks

Reported-and-tested-by: Stefan Priebe <>
Signed-off-by: Josef Bacik <>
Signed-off-by: Greg Kroah-Hartman <>
  • Loading branch information...
1 parent 98b3faa commit 8c7028941242372574880e513207abdbe486c3e5 Josef Bacik committed with gregkh Mar 26, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 fs/btrfs/extent-tree.c
2 fs/btrfs/extent-tree.c
@@ -3786,7 +3786,7 @@ static void update_global_block_rsv(struct btrfs_fs_info *fs_info)
- block_rsv->size = num_bytes;
+ block_rsv->size = min_t(u64, num_bytes, 512 * 1024 * 1024);
num_bytes = sinfo->bytes_used + sinfo->bytes_pinned +
sinfo->bytes_reserved + sinfo->bytes_readonly +

0 comments on commit 8c70289

Please sign in to comment.