]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.4.39/btrfs-limit-the-global-reserve-to-512mb.patch
5.0-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.4.39 / btrfs-limit-the-global-reserve-to-512mb.patch
1 From fdf30d1c1b386e1b73116cc7e0fb14e962b763b0 Mon Sep 17 00:00:00 2001
2 From: Josef Bacik <jbacik@fusionio.com>
3 Date: Tue, 26 Mar 2013 15:31:45 -0400
4 Subject: Btrfs: limit the global reserve to 512mb
5
6 From: Josef Bacik <jbacik@fusionio.com>
7
8 commit fdf30d1c1b386e1b73116cc7e0fb14e962b763b0 upstream.
9
10 A user reported a problem where he was getting early ENOSPC with hundreds of
11 gigs of free data space and 6 gigs of free metadata space. This is because the
12 global block reserve was taking up the entire free metadata space. This is
13 ridiculous, we have infrastructure in place to throttle if we start using too
14 much of the global reserve, so instead of letting it get this huge just limit it
15 to 512mb so that users can still get work done. This allowed the user to
16 complete his rsync without issues. Thanks
17
18 Reported-and-tested-by: Stefan Priebe <s.priebe@profihost.ag>
19 Signed-off-by: Josef Bacik <jbacik@fusionio.com>
20 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
21
22 ---
23 fs/btrfs/extent-tree.c | 2 +-
24 1 file changed, 1 insertion(+), 1 deletion(-)
25
26 --- a/fs/btrfs/extent-tree.c
27 +++ b/fs/btrfs/extent-tree.c
28 @@ -4217,7 +4217,7 @@ static void update_global_block_rsv(stru
29 spin_lock(&sinfo->lock);
30 spin_lock(&block_rsv->lock);
31
32 - block_rsv->size = num_bytes;
33 + block_rsv->size = min_t(u64, num_bytes, 512 * 1024 * 1024);
34
35 num_bytes = sinfo->bytes_used + sinfo->bytes_pinned +
36 sinfo->bytes_reserved + sinfo->bytes_readonly +