mkfs.f2fs: fix incorrect cold data location
authorChao Yu <yuchao0@huawei.com>
Wed, 4 Apr 2018 02:49:14 +0000 (10:49 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Sat, 14 Jul 2018 05:46:00 +0000 (22:46 -0700)
If last_zone((total_zones >> 2)) is equal or less than
next_zone(CURSEG_COLD_NODE), cold data area will be located in the
same position with hot data, fixes it.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
mkfs/f2fs_format.c

index 1a2deae..0a99a77 100644 (file)
@@ -471,7 +471,7 @@ static int f2fs_prepare_super_block(void)
                c.cur_seg[CURSEG_HOT_DATA] = next_zone(CURSEG_COLD_NODE);
                c.cur_seg[CURSEG_COLD_DATA] =
                                max(last_zone((total_zones >> 2)),
-                                       next_zone(CURSEG_COLD_NODE));
+                                       next_zone(CURSEG_HOT_DATA));
                c.cur_seg[CURSEG_WARM_DATA] =
                                max(last_zone((total_zones >> 1)),
                                        next_zone(CURSEG_COLD_DATA));