btrfs: handle priority ticket failures in their respective helpers
authorJosef Bacik <josef@toxicpanda.com>
Tue, 9 Nov 2021 15:12:01 +0000 (10:12 -0500)
committerDavid Sterba <dsterba@suse.com>
Mon, 3 Jan 2022 14:09:45 +0000 (15:09 +0100)
commit9f35f76d7df66507b698ac7298fb6c175a6aae7d
treef7d6f6edb46e07ea24766bc1fee941445b066515
parent16beac87e95e2fb278b552397c8260637f8a63f7
btrfs: handle priority ticket failures in their respective helpers

Currently the error case for the priority tickets is handled where we
deal with all of the tickets, priority and non-priority.  This is OK in
general, but it makes for some awkward locking.  We take and drop the
space_info->lock back to back because of these different types of
tickets.

Rework the code to handle priority ticket failures in their respective
helpers.  This allows us to be less wonky with our space_info->lock
usage, and means that the main handler simply has to check
ticket->error, as the ticket is guaranteed to be off any list and
completely handled by the time it exits one of the handlers.

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