Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751291AbdILE3T (ORCPT ); Tue, 12 Sep 2017 00:29:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:40492 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751045AbdILE3S (ORCPT ); Tue, 12 Sep 2017 00:29:18 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6D1C92133F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=jaegeuk@kernel.org Date: Mon, 11 Sep 2017 21:29:16 -0700 From: Jaegeuk Kim To: Chao Yu Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, daehojng@gmail.com Subject: Re: [f2fs-dev] [PATCH] f2fs: fix double count on issued discard commands Message-ID: <20170912042916.GA95671@jaegeuk-macbookpro.roam.corp.google.com> References: <20170911033845.53701-1-jaegeuk@kernel.org> <6209aa5a-4d45-ac2b-448a-4b405dfb25d1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6209aa5a-4d45-ac2b-448a-4b405dfb25d1@huawei.com> User-Agent: Mutt/1.8.2 (2017-04-18) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1206 Lines: 40 On 09/12, Chao Yu wrote: > On 2017/9/12 9:53, Chao Yu wrote: > > On 2017/9/11 11:38, Jaegeuk Kim wrote: > >> If issue_cond is true, it does double count for # of issued commands. > >> > >> Signed-off-by: Jaegeuk Kim > > > > Reviewed-by: Chao Yu > > As Daeho Jeong mentioned, the change makes 'iter > DISCARD_ISSUE_RATE' dead > code, I just misread iter and issued variable, sorry. :( Yeah, that's exactly like what I made a mistake before. I should have mentioned that earlier. :) > > Thanks, > > > > >> --- > >> fs/f2fs/segment.c | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> > >> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c > >> index 7fd742f747ce..25196ff5d587 100644 > >> --- a/fs/f2fs/segment.c > >> +++ b/fs/f2fs/segment.c > >> @@ -1087,7 +1087,7 @@ static int __issue_discard_cmd(struct f2fs_sb_info *sbi, bool issue_cond) > >> issued++; > >> __submit_discard_cmd(sbi, dc); > >> } > >> - if (issue_cond && iter++ > DISCARD_ISSUE_RATE) > >> + if (issue_cond && iter > DISCARD_ISSUE_RATE) > >> goto out; > >> } > >> if (list_empty(pend_list) && dcc->pend_list_tag[i] & P_TRIM) > >> > > > > > >