]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: always reserve our entire size for the global reserve
authorJosef Bacik <josef@toxicpanda.com>
Thu, 22 Aug 2019 19:19:01 +0000 (15:19 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 9 Sep 2019 12:59:19 +0000 (14:59 +0200)
commit1afcbdfebfe2a4a6ec526e6a72ed3326a5a2f0f4
tree86b548fcaef8f0534d936318bc1cffffe64cce66
parent54992073e76d438ee6d696575ea9abaab2ebf280
btrfs: always reserve our entire size for the global reserve

While messing with the overcommit logic I noticed that sometimes we'd
ENOSPC out when really we should have run out of space much earlier.  It
turns out it's because we'll only reserve up to the free amount left in
the space info for the global reserve, but that doesn't make sense with
overcommit because we could be well above our actual size.  This results
in the global reserve not carving out it's entire reservation, and thus
not putting enough pressure on the rest of the infrastructure to do the
right thing and ENOSPC out at a convenient time.  Fix this by always
taking our full reservation amount for the global reserve.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/block-rsv.c