* [PATCH v5] f2fs: stop issue discard if something wrong with f2fs
@ 2018-04-13 3:08 Yunlei He
2018-04-20 1:41 ` heyunlei
0 siblings, 1 reply; 2+ messages in thread
From: Yunlei He @ 2018-04-13 3:08 UTC (permalink / raw)
To: jaegeuk, yuchao0, linux-f2fs-devel; +Cc: zhangdianfang
v4->v5: move data corruption check to __submit_discard_cmd, in order to
control discard io submitted more accurately, besides, increase async
thread wait time if data corruption detected.
This patch stop async thread and umount process to issue discard
if something wrong with f2fs, which is similar to fstrim.
Signed-off-by: Yunlei He <heyunlei@huawei.com>
---
fs/f2fs/segment.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index d923ef5..991d1a2 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -929,6 +929,9 @@ static void __submit_discard_cmd(struct f2fs_sb_info *sbi,
if (dc->state != D_PREP)
return;
+ if (is_sbi_flag_set(sbi, SBI_NEED_FSCK))
+ return;
+
trace_f2fs_issue_discard(dc->bdev, dc->start, dc->len);
dc->error = __blkdev_issue_discard(dc->bdev,
@@ -1410,6 +1413,10 @@ static int issue_discard_thread(void *data)
continue;
if (kthread_should_stop())
return 0;
+ if (is_sbi_flag_set(sbi, SBI_NEED_FSCK)) {
+ wait_ms = dpolicy.max_interval;
+ continue;
+ }
if (dcc->discard_wake)
dcc->discard_wake = 0;
--
1.9.1
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH v5] f2fs: stop issue discard if something wrong with f2fs
2018-04-13 3:08 [PATCH v5] f2fs: stop issue discard if something wrong with f2fs Yunlei He
@ 2018-04-20 1:41 ` heyunlei
0 siblings, 0 replies; 2+ messages in thread
From: heyunlei @ 2018-04-20 1:41 UTC (permalink / raw)
To: heyunlei, jaegeuk@kernel.org, Yuchao (T),
linux-f2fs-devel@lists.sourceforge.net
Cc: Zhangdianfang (Euler)
>-----Original Message-----
>From: heyunlei
>Sent: Friday, April 13, 2018 11:08 AM
>To: jaegeuk@kernel.org; Yuchao (T); linux-f2fs-devel@lists.sourceforge.net
>Cc: Wangbintian; heyunlei; Zhangdianfang (Euler)
>Subject: [f2fs-dev][PATCH v5] f2fs: stop issue discard if something wrong with f2fs
>
>v4->v5: move data corruption check to __submit_discard_cmd, in order to
>control discard io submitted more accurately, besides, increase async
>thread wait time if data corruption detected.
>
>This patch stop async thread and umount process to issue discard
>if something wrong with f2fs, which is similar to fstrim.
>
>Signed-off-by: Yunlei He <heyunlei@huawei.com>
>---
> fs/f2fs/segment.c | 7 +++++++
> 1 file changed, 7 insertions(+)
Ping
Thanks.
>
>diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
>index d923ef5..991d1a2 100644
>--- a/fs/f2fs/segment.c
>+++ b/fs/f2fs/segment.c
>@@ -929,6 +929,9 @@ static void __submit_discard_cmd(struct f2fs_sb_info *sbi,
> if (dc->state != D_PREP)
> return;
>
>+ if (is_sbi_flag_set(sbi, SBI_NEED_FSCK))
>+ return;
>+
> trace_f2fs_issue_discard(dc->bdev, dc->start, dc->len);
>
> dc->error = __blkdev_issue_discard(dc->bdev,
>@@ -1410,6 +1413,10 @@ static int issue_discard_thread(void *data)
> continue;
> if (kthread_should_stop())
> return 0;
>+ if (is_sbi_flag_set(sbi, SBI_NEED_FSCK)) {
>+ wait_ms = dpolicy.max_interval;
>+ continue;
>+ }
>
> if (dcc->discard_wake)
> dcc->discard_wake = 0;
>--
>1.9.1
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-04-20 1:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-13 3:08 [PATCH v5] f2fs: stop issue discard if something wrong with f2fs Yunlei He
2018-04-20 1:41 ` heyunlei
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).