Skip to contentSkip to conversation

f2fs: fix to be aware discard/preflush/dio command in is_idle()

PATCH New Chao Yu 1 participant 1 message Nov 11, 2018 F2FS file system

lore
Share & tools
lore

Chao Yu

author maintainer
#0 lore raw

PATCH v3 1/1 f2fs: fix to be aware discard/preflush/dio command in is_idle()

From: Chao Yu <[email protected]>

This patch adds missing in-flight discard/preflush/dio command count check in is_idle().

---
v3:
- add in-flight r/w dio count check as well.

 fs/f2fs/f2fs.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
fs/f2fs/f2fs.h +5 -1
index 97c35036bf49..b1d5031be2d5 100644
@@ -2157,7 +2157,11 @@ static inline bool is_idle(struct f2fs_sb_info *sbi, int type)
 {
 	if (get_pages(sbi, F2FS_RD_DATA) || get_pages(sbi, F2FS_RD_NODE) ||
 		get_pages(sbi, F2FS_RD_META) || get_pages(sbi, F2FS_WB_DATA) ||
-		get_pages(sbi, F2FS_WB_CP_DATA))
+		get_pages(sbi, F2FS_WB_CP_DATA) ||
+		get_pages(sbi, F2FS_DIO_READ) ||
+		get_pages(sbi, F2FS_DIO_WRITE) ||
+		atomic_read(&SM_I(sbi)->dcc_info->issing_discard) ||
+		atomic_read(&SM_I(sbi)->fcc_info->issing_flush))
 		return false;
 	return f2fs_time_over(sbi, type);
 }
Signature · 1 line
2.18.0