Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp18798891ybl; Fri, 3 Jan 2020 09:13:58 -0800 (PST) X-Google-Smtp-Source: APXvYqynLcQuKVdnJtozQM7H5TqVYoZg+a4AVNCwIUXEulcaYZ6lH1eayCMzLw0EzQTx/IEicxd8 X-Received: by 2002:a9d:6f8c:: with SMTP id h12mr47749658otq.185.1578071638612; Fri, 03 Jan 2020 09:13:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578071638; cv=none; d=google.com; s=arc-20160816; b=HTdr2E84zZh/wStvs+BdOS/fP4MiI8anHqEOCc+tAk5cbA341jy4Z6ShbhPRidJjvR qjcmP2ntOLzj6DXoVK0UJLN+mvS2HWiuTa/ENoTn5e6AKw/SrQzNmqB4lVUFJlS9RI2f bi2wHrxXirnmKuZSPAVaxyDaSEdpMG7wz8kglEAFeEWivRFIlzRQHhqS4x8A/3qymYGF Hr2J4MZWz1ItdS1KOdkmbxD6wB5lSJqoIpOL90P39vQGcU1XYStREkqqQJe3102JcOKF hZhOfH1CnHtUL/ohaxS1tTW8Tyf/6xprz+7ejAAah0hMuk5pyCEDKR88XTq0h8uC6oKw hjjA== 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=wXpjMEZKKHgzUxPNG47mDpZ/ZZyG49zMiu+d8QnMhGY=; b=yZKr8cVJ+Q3UB4T3EeE4wLbuEkmMq7mF2hinUQmZFVJQgHImZuvskGWPerc72mvspo ugJOLXOtFxG6wC9jYwDTd39r0O8c3ghrdPRzkvHkIt26gqK6euuzodVH3oigyfD5zvV/ vLWjyySJk2wT/sQnc8jkJCXxkXaHdXPSQA71EniRk3tk096WcXm/WUb9YdwMKmT+wJod 4qyfJAubkc6IRq+HIyUJCpPisKXx0z+C3ztgl7zp7lAD+dOuJj+IA2aa0NKLw4ye/5V1 MnzKBPaN4Q0fJSL5x3LrJlPynrS3i1iC4ovGrpNBLhO7Mw1uEjK9vtoLPKQ8KUXRApv6 i+wg== 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 v7si37803450otr.44.2020.01.03.09.13.44; Fri, 03 Jan 2020 09:13:58 -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 S1728218AbgACRMR (ORCPT + 99 others); Fri, 3 Jan 2020 12:12:17 -0500 Received: from jabberwock.ucw.cz ([46.255.230.98]:52412 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728207AbgACRMP (ORCPT ); Fri, 3 Jan 2020 12:12:15 -0500 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id D641E1C2461; Fri, 3 Jan 2020 18:12:13 +0100 (CET) Date: Fri, 3 Jan 2020 18:12:13 +0100 From: Pavel Machek To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Chengguang Xu , Chao Yu , Jaegeuk Kim , Sasha Levin Subject: Re: [PATCH 4.19 062/114] f2fs: choose hardlimit when softlimit is larger than hardlimit in f2fs_statfs_project() Message-ID: <20200103171213.GC14328@amd> References: <20200102220029.183913184@linuxfoundation.org> <20200102220035.294585461@linuxfoundation.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="TiqCXmo5T1hvSQQg" Content-Disposition: inline In-Reply-To: <20200102220035.294585461@linuxfoundation.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --TiqCXmo5T1hvSQQg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > From: Chengguang Xu >=20 > [ Upstream commit 909110c060f22e65756659ec6fa957ae75777e00 ] >=20 > Setting softlimit larger than hardlimit seems meaningless > for disk quota but currently it is allowed. In this case, > there may be a bit of comfusion for users when they run > df comamnd to directory which has project quota. >=20 > For example, we set 20M softlimit and 10M hardlimit of > block usage limit for project quota of test_dir(project id 123). > Signed-off-by: Chengguang Xu > Reviewed-by: Chao Yu > Signed-off-by: Jaegeuk Kim > Signed-off-by: Sasha Levin > --- > fs/f2fs/super.c | 20 ++++++++++++++------ > 1 file changed, 14 insertions(+), 6 deletions(-) >=20 > diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c > index 7a9cc64f5ca3..662c7de58b99 100644 > --- a/fs/f2fs/super.c > +++ b/fs/f2fs/super.c > @@ -1148,9 +1148,13 @@ static int f2fs_statfs_project(struct super_block = *sb, > return PTR_ERR(dquot); > spin_lock(&dquot->dq_dqb_lock); > =20 > - limit =3D (dquot->dq_dqb.dqb_bsoftlimit ? > - dquot->dq_dqb.dqb_bsoftlimit : > - dquot->dq_dqb.dqb_bhardlimit) >> sb->s_blocksize_bits; > + limit =3D 0; > + if (dquot->dq_dqb.dqb_bsoftlimit) > + limit =3D dquot->dq_dqb.dqb_bsoftlimit; > + if (dquot->dq_dqb.dqb_bhardlimit && > + (!limit || dquot->dq_dqb.dqb_bhardlimit < limit)) > + limit =3D dquot->dq_dqb.dqb_bhardlimit; > + > if (limit && buf->f_blocks > limit) { >> blocksize disappeared here. That can't be right. Plus, is this just obfuscated way of saying limit =3D min_not_zero(dquot->dq_dqb.dqb_bsoftlimit, dquot->dq_dqb.dqb_bhar= dlimit)? Best regards, Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --TiqCXmo5T1hvSQQg Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAl4Pde0ACgkQMOfwapXb+vLqwgCfQB23lTPPylgzByCY4o28WHli ZSEAmwVz9M718u4eqzta/6qKREiJLCk4 =iDPi -----END PGP SIGNATURE----- --TiqCXmo5T1hvSQQg--