Skip to content

Commit b2840e3

Browse files
bvanasschekdave
authored andcommitted
btrfs: add missing RCU unlock in error path in try_release_subpage_extent_buffer()
Call rcu_read_lock() before exiting the loop in try_release_subpage_extent_buffer() because there is a rcu_read_unlock() call past the loop. This has been detected by the Clang thread-safety analyzer. Fixes: ad580df ("btrfs: fix subpage deadlock in try_release_subpage_extent_buffer()") CC: stable@vger.kernel.org # 6.18+ Reviewed-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Boris Burkov <boris@bur.io> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 5131fa0 commit b2840e3

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

fs/btrfs/extent_io.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4494,6 +4494,7 @@ static int try_release_subpage_extent_buffer(struct folio *folio)
44944494
*/
44954495
if (!test_and_clear_bit(EXTENT_BUFFER_TREE_REF, &eb->bflags)) {
44964496
spin_unlock(&eb->refs_lock);
4497+
rcu_read_lock();
44974498
break;
44984499
}
44994500

0 commit comments

Comments
 (0)