]> git.hungrycats.org Git - linux/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)
committerZygo Blaxell <zblaxell@waya.furryterror.org>
Sun, 22 Mar 2015 18:43:28 +0000 (14:43 -0400)
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>
(cherry picked from commit dc5f7a3bd820883793bb0d9789e938a34aa4da5f)

fs/btrfs/scrub.c

index 70f96994a61f5f1d2e75581cda922c3d9a0e609f..0cee01a4d6963a99f018dd75366bc5ca76adb1f6 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;