[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2e7be62f-62b3-bb9a-8831-8208d1d9eeb9@huawei.com>
Date: Sat, 28 May 2016 08:54:22 +0800
From: Chao Yu <yuchao0@...wei.com>
To: Chao Yu <chao@...nel.org>, <jaegeuk@...nel.org>
CC: <linux-f2fs-devel@...ts.sourceforge.net>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] f2fs: fix to redirty page if fail to gc data page
Ping,
On 2016/5/21 13:19, Chao Yu wrote:
> From: Chao Yu <yuchao0@...wei.com>
>
> If we fail to move data page during foreground GC, we should give another
> chance to writeback that page which was set dirty previously by writer.
>
> Signed-off-by: Chao Yu <yuchao0@...wei.com>
> ---
> fs/f2fs/gc.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
> index 38d56f6..ee213a8 100644
> --- a/fs/f2fs/gc.c
> +++ b/fs/f2fs/gc.c
> @@ -653,12 +653,15 @@ static void move_data_page(struct inode *inode, block_t bidx, int gc_type)
> .page = page,
> .encrypted_page = NULL,
> };
> + bool is_dirty = PageDirty(page);
> +
> set_page_dirty(page);
> f2fs_wait_on_page_writeback(page, DATA, true);
> if (clear_page_dirty_for_io(page))
> inode_dec_dirty_pages(inode);
> set_cold_data(page);
> - do_write_data_page(&fio);
> + if (do_write_data_page(&fio) && is_dirty)
> + set_page_dirty(page);
> clear_cold_data(page);
> }
> out:
>
Powered by blists - more mailing lists