linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [PATCH] f2fs: fix a last_victim overflow problem
@ 2017-03-22  2:54 Yunlei He
  2017-03-22  6:41 ` Chao Yu
  0 siblings, 1 reply; 2+ messages in thread
From: Yunlei He @ 2017-03-22  2:54 UTC (permalink / raw)
  To: jaegeuk, yuchao0, linux-f2fs-devel

This patch fix a last_victim overflow problem

Signed-off-by: Yunlei He <heyunlei@huawei.com>
---
 fs/f2fs/gc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index 418fd98..3b5e799a 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -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;
 		}
 	}
-- 
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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] f2fs: fix a last_victim overflow problem
  2017-03-22  2:54 [PATCH] f2fs: fix a last_victim overflow problem Yunlei He
@ 2017-03-22  6:41 ` Chao Yu
  0 siblings, 0 replies; 2+ messages in thread
From: Chao Yu @ 2017-03-22  6:41 UTC (permalink / raw)
  To: Yunlei He, jaegeuk, linux-f2fs-devel

Hi Yunlei,

Have sent a patch for fixing this issue.

[PATCH 2/2] f2fs: fix recording invalid last_victim

Thanks,

On 2017/3/22 10:54, Yunlei He wrote:
> This patch fix a last_victim overflow problem
> 
> Signed-off-by: Yunlei He <heyunlei@huawei.com>
> ---
>  fs/f2fs/gc.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
> index 418fd98..3b5e799a 100644
> --- a/fs/f2fs/gc.c
> +++ b/fs/f2fs/gc.c
> @@ -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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-22  6:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-22  2:54 [PATCH] f2fs: fix a last_victim overflow problem Yunlei He
2017-03-22  6:41 ` Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).