mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chao Yu <yuchao0@huawei.com>
To: Chao Yu <chao@kernel.org>, <jaegeuk@kernel.org>
Cc: <linux-f2fs-devel@lists.sourceforge.net>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] f2fs: fix to redirty page if fail to gc data page
Date: Sat, 28 May 2016 08:54:22 +0800	[thread overview]
Message-ID: <2e7be62f-62b3-bb9a-8831-8208d1d9eeb9@huawei.com> (raw)
In-Reply-To: <1463807951-10472-1-git-send-email-chao@kernel.org>

Ping,

On 2016/5/21 13:19, Chao Yu wrote:
> From: Chao Yu <yuchao0@huawei.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@huawei.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:
> 

  reply	other threads:[~2016-05-28  0:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-21  5:19 Chao Yu
2016-05-28  0:54 ` Chao Yu [this message]
2016-05-30  2:37 ` Jaegeuk Kim
2016-05-31  6:10   ` Chao Yu
2016-06-03  5:08     ` Jaegeuk Kim
2016-06-03  5:13       ` Chao Yu
2016-06-03  5:17         ` Jaegeuk Kim
2016-06-03  5:59           ` Chao Yu
2016-06-03 17:36             ` Jaegeuk Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2e7be62f-62b3-bb9a-8831-8208d1d9eeb9@huawei.com \
    --to=yuchao0@huawei.com \
    --cc=chao@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®