btrfs: make BTRFS_RESERVE_FLUSH_EVICT use the global rsv stealing code
authorJosef Bacik <josef@toxicpanda.com>
Tue, 9 Nov 2021 15:12:04 +0000 (10:12 -0500)
committerDavid Sterba <dsterba@suse.com>
Mon, 3 Jan 2022 14:09:45 +0000 (15:09 +0100)
commitee6adbfd6a2c15a71fb26d9321c97bef09ae0534
tree600ce87c693b2e6cdcec8c3ec4853a751c4a5e45
parent1b0309eaa426242e168cf6a51dd707962d81578b
btrfs: make BTRFS_RESERVE_FLUSH_EVICT use the global rsv stealing code

I forgot to convert this over when I introduced the global reserve
stealing code to the space flushing code.  Evict was simply trying to
make its reservation and then if it failed it would steal from the
global rsv, which is racey because it's outside of the normal ticketing
code.

Fix this by setting ticket->steal if we are BTRFS_RESERVE_FLUSH_EVICT,
and then make the priority flushing path do the steal for us.

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/inode.c
fs/btrfs/space-info.c