Thread (33 messages) 33 messages, 4 authors, 2021-11-29
STALE1693d

[PATCH 09/21] btrfs: zoned: skip zoned check if block_group is marked as copy

From: Johannes Thumshirn <hidden>
Date: 2021-11-24 09:31:08
Subsystem: btrfs file system, filesystems (vfs and infrastructure), the rest · Maintainers: Chris Mason, David Sterba, Alexander Viro, Christian Brauner, Linus Torvalds

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help