f2fs: fix wrong calculation of block age
authorqixiaoyu1 <qxy65535@gmail.com>
Thu, 2 Feb 2023 08:20:27 +0000 (16:20 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Mon, 6 Feb 2023 03:30:05 +0000 (19:30 -0800)
commitb03a41a495df35f8e8d25220878bd6b8472d9396
tree7be4793abf7e3c13db683e0344f6d1f484b3af30
parenta84153f939808102dfa10904aa0f743e734a3e1d
f2fs: fix wrong calculation of block age

Currently we wrongly calculate the new block age to
old * LAST_AGE_WEIGHT / 100.

Fix it to new * (100 - LAST_AGE_WEIGHT) / 100
                + old * LAST_AGE_WEIGHT / 100.

Signed-off-by: qixiaoyu1 <qixiaoyu1@xiaomi.com>
Signed-off-by: xiongping1 <xiongping1@xiaomi.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/extent_cache.c