]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
btrfs: loop in inode_rsv_refill
authorJosef Bacik <josef@toxicpanda.com>
Wed, 21 Nov 2018 19:03:11 +0000 (14:03 -0500)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 Feb 2019 13:13:35 +0000 (14:13 +0100)
commit5df1136363cabc4d3f92fc91e3f92bd6a5eebd27
tree8d58ce9b0e740b3695f20b0a217ebf935f6d97ee
parentf91587e4151e84f798f37839dddd3e4152fb4c76
btrfs: loop in inode_rsv_refill

With severe fragmentation we can end up with our inode rsv size being
huge during writeout, which would cause us to need to make very large
metadata reservations.

However we may not actually need that much once writeout is complete,
because of the over-reservation for the worst case.

So instead try to make our reservation, and if we couldn't make it
re-calculate our new reservation size and try again.  If our reservation
size doesn't change between tries then we know we are actually out of
space and can error. Flushing that could have been running in parallel
did not make any space.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
[ rename to calc_refill_bytes, update comment and changelog ]
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-tree.c