LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Chao Yu <chao@kernel.org>
To: Yangtao Li <frank.li@vivo.com>, jaegeuk@kernel.org
Cc: linux-f2fs-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org,
	Fengnan Chang <changfengnan@vivo.com>
Subject: Re: [PATCH 2/2] fs: Don't create discard thread when device not support realtime discard
Date: Wed, 11 Aug 2021 21:44:52 +0800	[thread overview]
Message-ID: <fc34fe7c-c7ec-3783-8cbc-de91ab81ee0a@kernel.org> (raw)
In-Reply-To: <20210811131826.223141-2-frank.li@vivo.com>

On 2021/8/11 21:18, Yangtao Li wrote:
> From: Fengnan Chang <changfengnan@vivo.com>
> 
> Don't create discard thread when device not support realtime discard.
> 
> Signed-off-by: Fengnan Chang <changfengnan@vivo.com>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
>   fs/f2fs/segment.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
> index 363779a4402d..bc4ac46f3041 100644
> --- a/fs/f2fs/segment.c
> +++ b/fs/f2fs/segment.c
> @@ -2161,6 +2161,8 @@ static int create_discard_cmd_control(struct f2fs_sb_info *sbi)
>   	init_waitqueue_head(&dcc->discard_wait_queue);
>   	SM_I(sbi)->dcc_info = dcc;
>   init_thread:
> +	if (!f2fs_realtime_discard_enable(sbi))

How about below case:
- mount -o nodiscard <dev> <mp>
- mount -o remount,discard <dev> <mp>

Thanks,

> +		return err;
>   	dcc->f2fs_issue_discard = kthread_run(issue_discard_thread, sbi,
>   				"f2fs_discard-%u:%u", MAJOR(dev), MINOR(dev));
>   	if (IS_ERR(dcc->f2fs_issue_discard)) {
> 

  reply	other threads:[~2021-08-11 13:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-11 13:18 [PATCH 1/2] f2fs: fix potential memory leaks in create_discard_cmd_control Yangtao Li
2021-08-11 13:18 ` [PATCH 2/2] fs: Don't create discard thread when device not support realtime discard Yangtao Li
2021-08-11 13:44   ` Chao Yu [this message]
2021-08-11 13:36 ` [PATCH 1/2] f2fs: fix potential memory leaks in create_discard_cmd_control Chao Yu

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=fc34fe7c-c7ec-3783-8cbc-de91ab81ee0a@kernel.org \
    --to=chao@kernel.org \
    --cc=changfengnan@vivo.com \
    --cc=frank.li@vivo.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH 2/2] fs: Don'\''t create discard thread when device not support realtime discard' \
    /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

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).