Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1720644 > unrolled thread

[PATCH] f2fs: collect prefree segments to avoild write checkpoint fail

Started byYunlong Song <yunlong.song@huawei.com>
First post2017-08-26 13:50 +0200
Last post2017-09-01 14:10 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] f2fs: collect prefree segments to avoild write checkpoint fail Yunlong Song <yunlong.song@huawei.com> - 2017-08-26 13:50 +0200
    Re: [PATCH] f2fs: collect prefree segments to avoild write checkpoint  fail Chao Yu <yuchao0@huawei.com> - 2017-08-28 12:00 +0200
    [PATCH v2] f2fs: collect prefree segments to avoild write checkpoint fail Yunlong Song <yunlong.song@huawei.com> - 2017-09-01 14:10 +0200

#1720644 — [PATCH] f2fs: collect prefree segments to avoild write checkpoint fail

FromYunlong Song <yunlong.song@huawei.com>
Date2017-08-26 13:50 +0200
Subject[PATCH] f2fs: collect prefree segments to avoild write checkpoint fail
Message-ID<uiHLc-F0-13@gated-at.bofh.it>
In come corner case, the reserved segments are used to do gc, and there are
not enough free segments for write checkpoint to finish its job, then the
gc process will fail to change the prefree segments to free segments.

Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
---
 fs/f2fs/gc.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index cd147e7..c8a828f 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -1056,6 +1056,13 @@ int f2fs_gc(struct f2fs_sb_info *sbi, bool sync,
 	if (!sync) {
 		if (has_not_enough_free_secs(sbi, sec_freed, 0)) {
 			segno = NULL_SEGNO;
+			if (prefree_segments(sbi) &&
+				has_not_enough_free_secs(sbi,
+					reserved_sections(sbi), 0)) {
+				ret = write_checkpoint(sbi, &cpc);
+				if (ret)
+					goto stop;
+			}
 			goto gc_more;
 		}
 
-- 
1.8.5.2

[toc] | [next] | [standalone]


#1721454 — Re: [PATCH] f2fs: collect prefree segments to avoild write checkpoint fail

FromChao Yu <yuchao0@huawei.com>
Date2017-08-28 12:00 +0200
SubjectRe: [PATCH] f2fs: collect prefree segments to avoild write checkpoint fail
Message-ID<ujoZQ-3ZF-3@gated-at.bofh.it>
In reply to#1720644
Hi Yunlong,

On 2017/8/26 19:46, Yunlong Song wrote:
> In come corner case, the reserved segments are used to do gc, and there are
> not enough free segments for write checkpoint to finish its job, then the
> gc process will fail to change the prefree segments to free segments.

How about doing investigate that why we haven't enough free segment for GC?

Thanks,

> 
> Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
> ---
>  fs/f2fs/gc.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
> index cd147e7..c8a828f 100644
> --- a/fs/f2fs/gc.c
> +++ b/fs/f2fs/gc.c
> @@ -1056,6 +1056,13 @@ int f2fs_gc(struct f2fs_sb_info *sbi, bool sync,
>  	if (!sync) {
>  		if (has_not_enough_free_secs(sbi, sec_freed, 0)) {
>  			segno = NULL_SEGNO;
> +			if (prefree_segments(sbi) &&
> +				has_not_enough_free_secs(sbi,
> +					reserved_sections(sbi), 0)) {
> +				ret = write_checkpoint(sbi, &cpc);
> +				if (ret)
> +					goto stop;
> +			}
>  			goto gc_more;
>  		}
>  
> 

[toc] | [prev] | [next] | [standalone]


#1725003 — [PATCH v2] f2fs: collect prefree segments to avoild write checkpoint fail

FromYunlong Song <yunlong.song@huawei.com>
Date2017-09-01 14:10 +0200
Subject[PATCH v2] f2fs: collect prefree segments to avoild write checkpoint fail
Message-ID<ukSVQ-4fd-21@gated-at.bofh.it>
In reply to#1720644
In come corner case, the reserved segments are used to do gc, and there are
not enough free segments for write checkpoint to finish its job, then the
gc process will fail to change the prefree segments to free segments.

Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
---
 fs/f2fs/gc.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index cd147e7..6552b04 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -1056,6 +1056,16 @@ int f2fs_gc(struct f2fs_sb_info *sbi, bool sync,
 	if (!sync) {
 		if (has_not_enough_free_secs(sbi, sec_freed, 0)) {
 			segno = NULL_SEGNO;
+#ifndef CONFIG_F2FS_CHECK_FS
+			if (prefree_segments(sbi) &&
+				has_not_enough_free_secs(sbi,
+					reserved_sections(sbi), 0)) {
+				ret = write_checkpoint(sbi, &cpc);
+				if (ret)
+					goto stop;
+				sec_freed = 0;
+			}
+#endif
 			goto gc_more;
 		}
 
-- 
1.8.5.2

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web