aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fusionio.com>2013-03-26 15:31:45 -0400
committerJosef Bacik <jbacik@fusionio.com>2013-03-28 09:51:29 -0400
commitfdf30d1c1b386e1b73116cc7e0fb14e962b763b0 (patch)
treea23f0ac6995d3cf5e753998e26107beb8337bf3e /fs
parentdb1d607d3ca5cbb283cbb17d648cd7e8dc67cc7b (diff)
Btrfs: limit the global reserve to 512mb
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 Cc: stable@vger.kernel.org Reported-and-tested-by: Stefan Priebe <s.priebe@profihost.ag> Signed-off-by: Josef Bacik <jbacik@fusionio.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 a22b5cc921ad..0d8478700d78 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -4460,7 +4460,7 @@ static void update_global_block_rsv(struct btrfs_fs_info *fs_info)
4460 spin_lock(&sinfo->lock); 4460 spin_lock(&sinfo->lock);
4461 spin_lock(&block_rsv->lock); 4461 spin_lock(&block_rsv->lock);
4462 4462
4463 block_rsv->size = num_bytes; 4463 block_rsv->size = min_t(u64, num_bytes, 512 * 1024 * 1024);
4464 4464
4465 num_bytes = sinfo->bytes_used + sinfo->bytes_pinned + 4465 num_bytes = sinfo->bytes_used + sinfo->bytes_pinned +
4466 sinfo->bytes_reserved + sinfo->bytes_readonly + 4466 sinfo->bytes_reserved + sinfo->bytes_readonly +