Skip to content

Commit c62f6be

Browse files
morbidrsakdave
authored andcommitted
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: 9283b9e ("btrfs: remove lock protection for BLOCK_GROUP_FLAG_TO_COPY") Signed-off-by: Johannes Thumshirn <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent a8d1b16 commit c62f6be

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

fs/btrfs/scrub.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3911,7 +3911,6 @@ int scrub_enumerate_chunks(struct scrub_ctx *sctx,
39113911

39123912
if (sctx->is_dev_replace && btrfs_is_zoned(fs_info)) {
39133913
if (!test_bit(BLOCK_GROUP_FLAG_TO_COPY, &cache->runtime_flags)) {
3914-
spin_unlock(&cache->lock);
39153914
btrfs_put_block_group(cache);
39163915
goto skip;
39173916
}

0 commit comments

Comments
 (0)