linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Chao Yu <yuchao0@huawei.com>
To: Yunlei He <heyunlei@huawei.com>,
	jaegeuk@kernel.org, linux-f2fs-devel@lists.sourceforge.net
Cc: zhangdianfang@huawei.com
Subject: Re: [PATCH v3] f2fs: stop issue discard if something wrong with f2fs
Date: Tue, 10 Apr 2018 10:36:12 +0800	[thread overview]
Message-ID: <c303bb52-c464-a122-e5ff-c95f5f7abecf@huawei.com> (raw)
In-Reply-To: <1523273251-29871-1-git-send-email-heyunlei@huawei.com>

On 2018/4/9 19:27, Yunlei He wrote:
> This patch stop async thread and umount process to issue discard
> if something wrong with f2fs, which is similar to fstrim.
> 
> v1->v2: add fs error check in not only discard thread but also umount process
> v2->v3: remove redundant error message
> 
> Signed-off-by: Yunlei He <heyunlei@huawei.com>
> ---
>  fs/f2fs/segment.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
> index 5854cc4..e31d506 100644
> --- a/fs/f2fs/segment.c
> +++ b/fs/f2fs/segment.c
> @@ -1202,6 +1202,9 @@ static int __issue_discard_cmd(struct f2fs_sb_info *sbi,
>  	int i, iter = 0, issued = 0;
>  	bool io_interrupted = false;
>  
> +	if (is_sbi_flag_set(sbi, SBI_NEED_FSCK))
> +		return issued;

Hmm.. except here, I mean we'd better add it into issue_discard_thread too?

Thanks,

> +
>  	for (i = MAX_PLIST_NUM - 1; i >= 0; i--) {
>  		if (i + 1 < dpolicy->granularity)
>  			break;
> 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

  reply	other threads:[~2018-04-10  2:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-09 11:27 [PATCH v3] f2fs: stop issue discard if something wrong with f2fs Yunlei He
2018-04-10  2:36 ` Chao Yu [this message]
2018-04-10  2:46   ` heyunlei
2018-04-10  3:12     ` 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=c303bb52-c464-a122-e5ff-c95f5f7abecf@huawei.com \
    --to=yuchao0@huawei.com \
    --cc=heyunlei@huawei.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=zhangdianfang@huawei.com \
    /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;
as well as URLs for NNTP newsgroup(s).