mkfs.f2fs: fix wrong ovp space calculation on large section
authorJaegeuk Kim <jaegeuk@kernel.org>
Wed, 23 Sep 2015 21:59:30 +0000 (14:59 -0700)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 23 Sep 2015 21:59:30 +0000 (14:59 -0700)
commit6e2b58dcaffc2d88291e07fa1f99773eca04a58f
tree4bfdf16b5bfde919fe9cd921175eb0c93c9415c0
parent6f9c275125853d4195c4913b817ddc97510409c5
mkfs.f2fs: fix wrong ovp space calculation on large section

If a section consists of multiple segments, we should change the equation
to apply it on reserved space.

On 128GB,

option                 overprovision area         reserved area
-o5 -s128              9094                       6144
-o5 -s64               6179                       3072
-o5 -s1                3309                       48
-o1 -s128              27009                      26624
-o1 -s64               13831                      13312
-o1 -s1                858                        208

-s1                    858                        208
-s64   *               13831                      13312
-s128  *               27009                      26624
: * should be wrong.

After patch,

-s1    (ovp:1%)        858                        208
-s64   (ovp:4%)        6172                       3712
-s128  (ovp:6%)        8721                       5120

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
mkfs/f2fs_format.c