]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitd6b649e7e1f75267425e1a96927b652e1af589c3
tree600ce87c693b2e6cdcec8c3ec4853a751c4a5e45
parent3324b507087dc8bda0116f2c124d6a458330f143
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