f2fs: fix a last_victim overflow problem
PATCH 1/1 f2fs: fix a last_victim overflow problem
This patch fix a last_victim overflow problem
Signed-off-by Yunlei He <[email protected]>
--- fs/f2fs/gc.c | 2 ++ 1 file changed, 2 insertions(+)
fs/f2fs/gc.c +2 -0
@@ -361,6 +361,8 @@ static int get_victim_by_default(struct f2fs_sb_info *sbi, sbi->last_victim[p.gc_mode] = last_victim +1 ; else sbi->last_victim[p.gc_mode] = segno + 1; + + sbi->last_victim[p.gc_mode] %=MAIN_SEGS (sbi);break ; } }
Signature · 6 lines
2.10.1 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Hi Yunlei,
Have sent a patch for fixing this issue.
[PATCH 2/2] f2fs: fix recording invalid last_victim
Thanks,
Quoted 13 lines · Yunlei He
This patch fix a
last_victimoverflow problemSigned-off-by Yunlei He <[email protected]>--- fs/f2fs/gc.c | 2 ++ 1 file changed, 2 insertions(+)fs/f2fs/gc.c +0
-0
fs/f2fs/gc.c static int get_victim_by_default(struct f2fs_sb_info *sbi, · line 368
Quoted 8 lines
fs/f2fs/gc.c +2
-0@@ -361,6 +361,8 @@ static int get_victim_by_default(struct f2fs_sb_info *sbi, sbi->last_victim[p.gc_mode] = last_victim +1 ; else sbi->last_victim[p.gc_mode] = segno + 1; + + sbi->last_victim[p.gc_mode] %=MAIN_SEGS (sbi);break ; } }
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot