Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp712702ybc; Tue, 19 Nov 2019 08:06:01 -0800 (PST) X-Google-Smtp-Source: APXvYqyXURPQuWWcRlhTMDWJFuJk3vzncN8f+gLkfojLSfsytt4ELftFX58A1Vd0RdQG1iYXssqE X-Received: by 2002:adf:db86:: with SMTP id u6mr15907554wri.318.1574179560845; Tue, 19 Nov 2019 08:06:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574179560; cv=none; d=google.com; s=arc-20160816; b=lkpJSl2j0ffua8ptU24ZwzFwCS/Gz128rAEc8x5cTnbuaO8Ms7/icY9gilzjzuBqeq VVsmxwBkOsYWj3Y9FRSNbA7NrTcKAmVn4uE0+hXhDDhkt7w6U1ckM6GbvpA9GEozMULS pX1mtDCSPxdX0UcxJl4ABFLcH99Xk48bkGTi8dIj5hc8emRKOGN88KchNaGS4bROjzVj 2IyvL+thoKGgT9T2H4J4t/swj4Lf1MIdrzU/4adxNQP/PoikTwpiNjI45chghVjgB9lM qgS4GYwWqrNvGpkSGpVH/QlYMyqrIvoQgFnfFD3aMEpLEN1VnSR/kCHfNdU6x0aCkiFC U9pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=k18Dz70w26xhPWb8zjB02sqdJQw4g7fGHMQPDPdcQAo=; b=ZO0HgeyCsYjxPbc99w0U6H4/tHF0FqEcH1xIcPuiUFavQydAHoklBZtz/OHVnVrEI1 9YyGIbOqXAsl4caQAFFdqlH3hdTTjzJwxiXPPdoHu+qoCfTqwLy5LVsLCC2jy3fdT9Et 7um0G1jp5tKGly8Ah8V9ZLfzZOS0b251z+kipISEExYVIipQJjZZ6wtnwqGgdbn53T+Z E19s/KeBBX1lZT38Dmc6kKEAuWzJlj5a8g7ctQ5VkUgkRDc60lBfQkVopakF4gneUZ8a UysMji2kpk/HogAHval4molMNODiyj3IhgBSu96heP7gu8Lawb1kpKDf72i4VO9J090E lxNQ== ARC-Authentication-Results: i=1; mx.google.com; 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 l11si14247199ejq.208.2019.11.19.08.05.36; Tue, 19 Nov 2019 08:06:00 -0800 (PST) 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; 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 S1728212AbfKSQDp (ORCPT + 99 others); Tue, 19 Nov 2019 11:03:45 -0500 Received: from mx2.suse.de ([195.135.220.15]:46268 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727728AbfKSQDp (ORCPT ); Tue, 19 Nov 2019 11:03:45 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D9A1BB30B; Tue, 19 Nov 2019 16:03:43 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 187A01E47E5; Tue, 19 Nov 2019 17:03:43 +0100 (CET) Date: Tue, 19 Nov 2019 17:03:43 +0100 From: Jan Kara To: Chengguang Xu Cc: jack@suse.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] quota: remove unnecessary check in dquot_add_inodes() and dquot_add_space() Message-ID: <20191119160343.GA2440@quack2.suse.cz> References: <20191117132028.19564-1-cgxu519@mykernel.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191117132028.19564-1-cgxu519@mykernel.net> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun 17-11-19 21:20:28, Chengguang Xu wrote: > After passed grace time we treat softlimit as hardlimit, > so we don't have to compare desire usage with softlimit > in this place. > > Signed-off-by: Chengguang Xu Thanks for the patch! I guess you mean that when dqb_itime is set, we are sure that softlimit is exceeded. You are right but the benefit of your change is not big and I prefer to keep the current "defensive" condition. Honza > --- > fs/quota/dquot.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c > index 6e826b454082..97740077afac 100644 > --- a/fs/quota/dquot.c > +++ b/fs/quota/dquot.c > @@ -1283,7 +1283,6 @@ static int dquot_add_inodes(struct dquot *dquot, qsize_t inodes, > } > > if (dquot->dq_dqb.dqb_isoftlimit && > - newinodes > dquot->dq_dqb.dqb_isoftlimit && > dquot->dq_dqb.dqb_itime && > ktime_get_real_seconds() >= dquot->dq_dqb.dqb_itime && > !ignore_hardlimit(dquot)) { > @@ -1333,7 +1332,6 @@ static int dquot_add_space(struct dquot *dquot, qsize_t space, > } > > if (dquot->dq_dqb.dqb_bsoftlimit && > - tspace > dquot->dq_dqb.dqb_bsoftlimit && > dquot->dq_dqb.dqb_btime && > ktime_get_real_seconds() >= dquot->dq_dqb.dqb_btime && > !ignore_hardlimit(dquot)) { > -- > 2.21.0 > > > -- Jan Kara SUSE Labs, CR