Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751253AbdILBx0 (ORCPT ); Mon, 11 Sep 2017 21:53:26 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:6031 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750967AbdILBxZ (ORCPT ); Mon, 11 Sep 2017 21:53:25 -0400 Subject: Re: [f2fs-dev] [PATCH] f2fs: fix double count on issued discard commands To: Jaegeuk Kim , , , References: <20170911033845.53701-1-jaegeuk@kernel.org> From: Chao Yu Message-ID: Date: Tue, 12 Sep 2017 09:53:19 +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: <20170911033845.53701-1-jaegeuk@kernel.org> 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.0A090203.59B73E0F.00A2,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: 799 Lines: 25 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 > --- > 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) >