fsck.f2fs: do not check the first seg in a sec in find_next_free_block
authorSheng Yong <shengyong1@huawei.com>
Mon, 24 Oct 2016 02:16:04 +0000 (10:16 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Mon, 31 Oct 2016 17:59:24 +0000 (10:59 -0700)
The first segment is already checked, so there is no need to check it
again if we want to make sure the whole section is freed.

Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fsck/mount.c

index ca7f6dd..0a47bf7 100644 (file)
@@ -1573,7 +1573,7 @@ int find_next_free_block(struct f2fs_sb_info *sbi, u64 *to, int left, int type)
                        struct seg_entry *se2;
                        unsigned int i;
 
-                       for (i = 0; i < sbi->segs_per_sec; i++) {
+                       for (i = 1; i < sbi->segs_per_sec; i++) {
                                se2 = get_seg_entry(sbi, segno + i);
                                if (se2->valid_blocks)
                                        break;