Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3807807ybi; Mon, 29 Jul 2019 13:02:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqwOlnG3EVZIlp+CrWE7ACYDz1pFtqiGKKEfXvo3NtTmtsBdq35CgLh/8LadzoH92PB4hQQk X-Received: by 2002:a62:1d8f:: with SMTP id d137mr39187470pfd.207.1564430535954; Mon, 29 Jul 2019 13:02:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564430535; cv=none; d=google.com; s=arc-20160816; b=DNOMzeBZhIXAtDrqJ9vXQqDBhyKrxcaajPoekjrzyeu6Y9XLsoWXztKArplry6bDh2 OGJ86rl0QQHDARqUc0gVIDBTVzEICd9XpBRmeUWYRhr7a8sxy7kjALNy1OWVBHEeZxz0 GurJ/woxcsWL6bpSOtASp3fGPjS4+5wZzkh0GEhq+1IX21hTFMpZHDiC93DkmiK8CMQq nI+/51gciN2FEXZZzueWJjg1l8eUvLlHNcmuHdyBADFh1uPOjByI5PBwbWxaCpkPgYQU maIzVxrCkmd7fQXLBhhqGuMbuI198ihPnmVGEHqyUWdhzWk3xnY+z+dUePJ7kc24P0sE 1QwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mf203d7CJ36voiARg5AKJ4lMpAUfEHP/i/A14b+2r6I=; b=Ai1c5dGK+IPxpLAF7EQnxCohYn8/heFZ/TE1PajDpu9A+1u3Aeqqkbw2fVZAh9p+4a +bzSHnX1MxtFMTXfja2ewy9+h5jLFiCGeOM4k47Tl8O2t/sYjPPyS314c860ujRSWJ4Z rEfoHo/3W6+dg5q+mPJXcRgFHZ6JvtOr3ZpVits89eqQB2ajDUIl537TWJ3xchyK717j +ehRz/ko9XgAkGo/4CB1rxN0qKPaF1QbBSCRFJm2EDUJKaNcRXsUObzzGQ9VQbsqA2K3 Q1555rDwoFCYrVMF4ovpXwji4/0T2MexUn5/F52c1HRHNwm8HTSWQ3YCqnW9f1g+7bW/ +53A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FYBoqNeA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y8si25113566plk.428.2019.07.29.13.02.00; Mon, 29 Jul 2019 13:02:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FYBoqNeA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391117AbfG2UAr (ORCPT + 99 others); Mon, 29 Jul 2019 16:00:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:43940 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390845AbfG2TwJ (ORCPT ); Mon, 29 Jul 2019 15:52:09 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EE9BF2064A; Mon, 29 Jul 2019 19:52:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564429929; bh=TFHEh57DC7xyPOl+8kUcu3/BHPOuWL6154cPQrf6WZw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FYBoqNeA9Ei47q63zefd/OBBDipNp6IFDF30KGt5mrjxob/boyDQf5Y39g6jA9+rg VlLvC7/Tkphw8Q/vrSEWF3y7mTWPhN4xAOBmIZVeoDmJnRMr10Bgato8/yV/ILdWGJ G/lhT6V36KbDAH7NLqzgoIz3Q20w7cRzJK0vd4eA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Heng Xiao , Chao Yu , Jaegeuk Kim , Sasha Levin Subject: [PATCH 5.2 141/215] f2fs: fix to avoid long latency during umount Date: Mon, 29 Jul 2019 21:22:17 +0200 Message-Id: <20190729190804.025561321@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190739.971253303@linuxfoundation.org> References: <20190729190739.971253303@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 6e0cd4a9dd4df1a0afcb454f1e654b5c80685913 ] 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 [Chao Yu: add commit message] Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim Signed-off-by: Sasha Levin --- fs/f2fs/segment.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 8903b61457e7..291f7106537c 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -1486,6 +1486,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.20.1