]> git.baikalelectronics.ru Git - kernel.git/commit
f2fs: fix recording invalid last_victim
authorChao Yu <yuchao0@huawei.com>
Tue, 21 Mar 2017 12:09:45 +0000 (20:09 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 24 Mar 2017 19:10:48 +0000 (15:10 -0400)
commitdb4486ea2df915914f44f627387158f471fc4c23
treeb60c808243ffc2ce2538769c8d979bd04ade01a6
parent214f759c005e5cf01c6d878568c48308f11241d0
f2fs: fix recording invalid last_victim

When doing garbage collection, we try to record segment offset which
locates at next one of last victim, using it as the start offset in
next searching.

But in some corner cases, recorded offset may cross the end of main
segment area, it will cause incorrectly searching in dirty_segmap
bitmap. This patch adds modular operation to avoid this issue.

Reported-by: Yunlei He <heyunlei@huawei.com>
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/gc.c