[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20190703022957.58312-1-yuchao0@huawei.com>
Date: Wed, 3 Jul 2019 10:29:57 +0800
From: Chao Yu <yuchao0@...wei.com>
To: <jaegeuk@...nel.org>
CC: <linux-f2fs-devel@...ts.sourceforge.net>,
<linux-kernel@...r.kernel.org>, <chao@...nel.org>,
Heng Xiao <heng.xiao@...soc.com>, Chao Yu <yuchao0@...wei.com>
Subject: [PATCH] f2fs: fix to avoid long latency during umount
From: Heng Xiao <heng.xiao@...soc.com>
In umount, we give an constand time to handle pending discard, previously,
in __issue_discard_cmd() we missed to check timeout condition in loop,
result in delaying long time, fix it.
Signed-off-by: Heng Xiao <heng.xiao@...soc.com>
[Chao Yu: add commit message]
Signed-off-by: Chao Yu <yuchao0@...wei.com>
---
fs/f2fs/segment.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index d886f796bb96..402fbbbb2d7c 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -1507,6 +1507,10 @@ static int __issue_discard_cmd(struct f2fs_sb_info *sbi,
list_for_each_entry_safe(dc, tmp, pend_list, list) {
f2fs_bug_on(sbi, dc->state != D_PREP);
+ if (dpolicy->timeout != 0 &&
+ f2fs_time_over(sbi, dpolicy->timeout))
+ break;
+
if (dpolicy->io_aware && i < dpolicy->io_aware_gran &&
!is_idle(sbi, DISCARD_TIME)) {
io_interrupted = true;
--
2.18.0.rc1
Powered by blists - more mailing lists