When enumerating chunks for scrub, we check if the block_group is marked
as to copy and if yes we skip the block_group.
As the to_copy logic is only used in a zoned filesystem, it's pointless to
check if the filesystem is zoned.
Signed-off-by: Johannes Thumshirn <redacted>
---
fs/btrfs/scrub.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index 30bb304bb5e9a..70cf1f487748c 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -3732,15 +3732,13 @@ int scrub_enumerate_chunks(struct scrub_ctx *sctx,
if (!cache)
goto skip;
- if (sctx->is_dev_replace && btrfs_is_zoned(fs_info)) {
- spin_lock(&cache->lock);
- if (!cache->to_copy) {
- spin_unlock(&cache->lock);
- btrfs_put_block_group(cache);
- goto skip;
- }
+ spin_lock(&cache->lock);
+ if (sctx->is_dev_replace && !cache->to_copy) {
spin_unlock(&cache->lock);
+ btrfs_put_block_group(cache);
+ goto skip;
}
+ spin_unlock(&cache->lock);
/*
* Make sure that while we are scrubbing the corresponding block--
2.31.1