btrfs: use find_first_extent_bit in btrfs_clean_io_failure
authorJosef Bacik <josef@toxicpanda.com>
Fri, 9 Sep 2022 21:53:17 +0000 (17:53 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 26 Sep 2022 10:28:02 +0000 (12:28 +0200)
commitcdca85b092fbf4ce6f209b174ac3e7ef2b80bebf
tree3fd34bed404283eea8b8dacbe9c1cfe6843fb874
parent87c11705cc94d6b822551e88d8d4579fe0370051
btrfs: use find_first_extent_bit in btrfs_clean_io_failure

Currently we're using find_first_extent_bit_state to check if our state
contains the given failrec range, however this is more of an internal
extent_io_tree helper, and is technically unsafe to use because we're
accessing the state outside of the extent_io_tree lock.

Instead use the normal helper find_first_extent_bit which returns the
range of the extent state we find in find_first_extent_bit_state and use
that to do our sanity checking.

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/extent_io.c