btrfs: move missing device handling in a dedicate function
authorNikolay Borisov <nborisov@suse.com>
Tue, 11 Jan 2022 16:00:26 +0000 (18:00 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Jan 2023 10:59:05 +0000 (11:59 +0100)
commit9c3beebd21f33f6e5bb48e5d0c3c6d3f0074847e
treea0bd3eae09a54ddef1276ff54e2bc5c3f8cf327e
parent7528b21cebe0a470a39dc49c2f37f4fed64e108b
btrfs: move missing device handling in a dedicate function

[ Upstream commit ff37c89f94be14b0e22a532d1e6d57187bfd5bb8 ]

This simplifies the code flow in read_one_chunk and makes error handling
when handling missing devices a bit simpler by reducing it to a single
check if something went wrong. No functional changes.

Reviewed-by: Su Yue <l@damenly.su>
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Stable-dep-of: 1742e1c90c3d ("btrfs: fix extent map use-after-free when handling missing device in read_one_chunk")
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/btrfs/volumes.c