]> git.baikalelectronics.ru Git - 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)
commit561bac3281f474f306503d92949cd461a2a3e5da
tree8d58ce9b0e740b3695f20b0a217ebf935f6d97ee
parent9c0747df412e595aff3e738e644785e3d74b758d
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