]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
Btrfs: Break loop when reach BTRFS_MAX_MIRRORS in scrub_setup_recheck_block()
authorZhao Lei <zhaolei@cn.fujitsu.com>
Tue, 20 Jan 2015 07:11:39 +0000 (15:11 +0800)
committerChris Mason <clm@fb.com>
Thu, 22 Jan 2015 02:06:48 +0000 (18:06 -0800)
Use break instead of useless loop should be more suitable in this
case.

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/scrub.c

index f9e108bdfc45642cdbf58b70913818405dc050b0..68867b2e4620cd6a918d8fa55de94be810ba09a7 100644 (file)
@@ -1394,7 +1394,7 @@ static int scrub_setup_recheck_block(struct scrub_ctx *sctx,
                        struct scrub_page *page;
 
                        if (mirror_index >= BTRFS_MAX_MIRRORS)
-                               continue;
+                               break;
 
                        sblock = sblocks_for_recheck + mirror_index;
                        sblock->sctx = sctx;