]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: zoned: fix locking imbalance on scrub
authorJohannes Thumshirn <johannes.thumshirn@wdc.com>
Fri, 4 Nov 2022 14:12:35 +0000 (07:12 -0700)
committerDavid Sterba <dsterba@suse.com>
Mon, 7 Nov 2022 13:35:25 +0000 (14:35 +0100)
commitc8935b173fa866fa1a966082bd779bdc5853de73
tree9dd5189d111a2b43d19f54478df717662162efe1
parent11c96db138c85a74ece52b4799ceb41b193c7f0e
btrfs: zoned: fix locking imbalance on scrub

If we're doing device replace on a zoned filesystem and discover in
scrub_enumerate_chunks() that we don't have to copy the block group it is
unlocked before it gets skipped.

But as the block group hasn't yet been locked before it leads to a locking
imbalance. To fix this simply remove the unlock.

This was uncovered by fstests' testcase btrfs/163.

Fixes: f82227f39497 ("btrfs: remove lock protection for BLOCK_GROUP_FLAG_TO_COPY")
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/scrub.c