linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] f2fs: stop issue discard if something wrong with f2fs
@ 2018-04-08  7:11 Yunlei He
  2018-04-08  7:11 ` [PATCH 2/2] f2fs: let discard thread wait a little longer if dev is busy Yunlei He
  2018-04-08  8:26 ` [PATCH 1/2] f2fs: stop issue discard if something wrong with f2fs Chao Yu
  0 siblings, 2 replies; 6+ messages in thread
From: Yunlei He @ 2018-04-08  7:11 UTC (permalink / raw)
  To: jaegeuk, yuchao0, linux-f2fs-devel

This patch stop discard thread to issue discard io if
something wrong with f2fs, which is similar to fstrim.

Signed-off-by: Yunlei He <heyunlei@huawei.com>
---
 fs/f2fs/segment.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 5854cc4..f75f503 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -1410,6 +1410,11 @@ static int issue_discard_thread(void *data)
 			continue;
 		if (kthread_should_stop())
 			return 0;
+		if (is_sbi_flag_set(sbi, SBI_NEED_FSCK)) {
+			f2fs_msg(sbi->sb, KERN_WARNING,
+				"Found FS corruption, run fsck to fix.");
+			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] 6+ messages in thread

end of thread, other threads:[~2018-04-08 11:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-08  7:11 [PATCH 1/2] f2fs: stop issue discard if something wrong with f2fs Yunlei He
2018-04-08  7:11 ` [PATCH 2/2] f2fs: let discard thread wait a little longer if dev is busy Yunlei He
2018-04-08 11:01   ` Chao Yu
2018-04-08  8:26 ` [PATCH 1/2] f2fs: stop issue discard if something wrong with f2fs Chao Yu
2018-04-08  9:19   ` heyunlei
2018-04-08 10:01     ` Chao Yu

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