Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751291AbdILDxQ (ORCPT ); Mon, 11 Sep 2017 23:53:16 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:6036 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751022AbdILDxO (ORCPT ); Mon, 11 Sep 2017 23:53:14 -0400 Subject: Re: [f2fs-dev] [PATCH] f2fs: fix double count on issued discard commands From: Chao Yu To: Jaegeuk Kim , , , References: <20170911033845.53701-1-jaegeuk@kernel.org> CC: Message-ID: <6209aa5a-4d45-ac2b-448a-4b405dfb25d1@huawei.com> Date: Tue, 12 Sep 2017 11:53:09 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.134.22.195] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020203.59B75A27.0076,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 9bddbb6907e1f56a2885758ef8bb27fd Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1012 Lines: 35 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. :( 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) >> > > >