Skip to contentSkip to conversation

f2fs: stop issue discard if something wrong with f2fs

PATCH Superseded Yunlei He 2 participants 3 messages Apr 10, 2018 – Apr 13, 2018 F2FS file system

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Yunlei He

author
#0 lore raw

PATCH v4 1/1 f2fs: stop issue discard if something wrong with f2fs

This patch stop async thread and umount process to issue discard if something wrong with f2fs, which is similar to fstrim.

---
 fs/f2fs/segment.c | 5 +++++
 1 file changed, 5 insertions(+)
fs/f2fs/segment.c +5 -0
index 5854cc4..1659985 100644
@@ -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;
+
 	for (i = MAX_PLIST_NUM - 1; i >= 0; i--) {
 		if (i + 1 < dpolicy->granularity)
 			break;
@@ -1410,6 +1413,8 @@ static int issue_discard_thread(void *data)
 			continue;
 		if (kthread_should_stop())
 			return 0;
+		if (is_sbi_flag_set(sbi, SBI_NEED_FSCK))
+			continue;
 
 		if (dcc->discard_wake)
 			dcc->discard_wake = 0;
Signature · 6 lines
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
Reviewed-by on v4 1/1
#1 lore raw
Quoted 4 lines · Yunlei He

This patch stop async thread and umount process to issue discard if something wrong with f2fs, which is similar to fstrim.

Thanks,

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

#2 lore raw
Quoted 7 lines · Chao Yu
Quoted 4 lines · Yunlei He

This patch stop async thread and umount process to issue discard if something wrong with f2fs, which is similar to fstrim.

Sorry, please hold on this patch before we fix the SBI_NEED_FSCK's ambiguity sematic issue.

Thanks,

Quoted 4 lines

Thanks,

Quoted 9 lines

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linux-f2fs-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

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