Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1572788ybl; Sat, 1 Feb 2020 01:28:39 -0800 (PST) X-Google-Smtp-Source: APXvYqwUZ5YiagZ6XVmZNbDQ9wifh+5zECb0MPziTeniutUANBSOTSPJGmJ+JHeJC8GyerziW0Ca X-Received: by 2002:a54:4e96:: with SMTP id c22mr9265604oiy.110.1580549318892; Sat, 01 Feb 2020 01:28:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580549318; cv=none; d=google.com; s=arc-20160816; b=zWmA4VsQy7DrEHKvGITJ2XK49z9JICeRo/EacWlPc8fMnfLLa+ZFcOvyVYjX2d4Txe aG2CnvnAXnVGuHeIbW+xe49p6Jo6s4IXe0K73+g2TGgx4PiU2zPMWzl7adcjM8+0TryN M+aKPtXokZN3j6EGRZOoN80zaAZw2Yq6oIaMxePd2VE+16qEWqhK/SrF+Hhrgh3bJUjm JgUBKSZObpg7YJ9GpCD2zj1JmjrerGMD8eHukieVl4otyZ9o4HOKvENOKocW0PPDJV6K XoAZ2cg5yeLLXQLiuGZOl2kzxuX3rmml7p8/4bjboGpkGoh3qjsF/jREpg/sUy9L809A 4asw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-transfer-encoding :mime-version:subject:references:in-reply-to:message-id:cc:to :reply-to:from:date:dkim-signature; bh=iE8Hhw8qHt9Pqui/X5oxG6qwvlfgUokk5lTAAAe7Pic=; b=xfH9nSvzbOxkXq/X6yKdgj3I9CAGUhnFVlAZQK4LquK5caiyX233OIGNfSgakSydOb gTeRU5B+XkJUhU8+moJKcHM6IVzMLmyiB40aSyUUBOkYRe4xzB5GQk41iiwoOzxBo98o EkJ96ObFA8QKoDyiwi4M+di6ZQnRT25P9hEPzAdTSFZ0XFVgJca3b+QmSIVvDsSQGmQT yWnb39hY5qu4/Itl/ofSd2A6CjCEkUb15vWVuW3wuc1rGqnXk7W/dwOtFavv3V17jnJx MQIG/TZZjQ5sgVKsmPjk8svQeonQPR3qPfaTP5ZQ1UbwW6R6pyM5TB/xITeQ+TovwZtj dlnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mykernel.net header.s=zohomail header.b=Yl8nJSle; 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 a22si5284165oii.98.2020.02.01.01.27.56; Sat, 01 Feb 2020 01:28:38 -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; dkim=pass header.i=@mykernel.net header.s=zohomail header.b=Yl8nJSle; 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 S1726335AbgBAJZF (ORCPT + 99 others); Sat, 1 Feb 2020 04:25:05 -0500 Received: from sender2-pp-o92.zoho.com.cn ([163.53.93.251]:25391 "EHLO sender2-pp-o92.zoho.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726197AbgBAJZF (ORCPT ); Sat, 1 Feb 2020 04:25:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1580549067; s=zohomail; d=mykernel.net; i=cgxu519@mykernel.net; h=Date:From:Reply-To:To:Cc:Message-ID:In-Reply-To:References:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=iE8Hhw8qHt9Pqui/X5oxG6qwvlfgUokk5lTAAAe7Pic=; b=Yl8nJSlex0iCOEpfOfzb43kzM+aAEx/E0tyL/Z8gsXODpFTh3lU4CyrUMH/XTsrd bazvdajnbucaZCVSQv9Q6ndnPJtdssxggMofvV5twyPlpmI0uRNfv/jUkuHRlHPNk+8 GtX/315EjZqJ/caNrmVfHC9CBsr3hYA10UpRewHs= Received: from mail.baihui.com by mx.zoho.com.cn with SMTP id 1580549065800805.4637087191738; Sat, 1 Feb 2020 17:24:25 +0800 (CST) Date: Sat, 01 Feb 2020 17:24:25 +0800 From: Chengguang Xu Reply-To: cgxu519@mykernel.net To: "Greg Kroah-Hartman" Cc: "Pavel Machek" , "linux-kernel" , "stable" , "Chao Yu" , "Jaegeuk Kim" , "Sasha Levin" Message-ID: <1700010cc3e.12eb876364380.7472123035435503364@mykernel.net> In-Reply-To: <20200104115308.GA1296856@kroah.com> References: <20200102220029.183913184@linuxfoundation.org> <20200102220035.294585461@linuxfoundation.org> <20200103171213.GC14328@amd> <16f6e3f5bbe.d291a05d38838.5222280714928609391@mykernel.net> <20200104115308.GA1296856@kroah.com> Subject: Re: [PATCH 4.19 062/114] f2fs: choose hardlimit when softlimit is larger than hardlimit in f2fs_statfs_project() MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Priority: Medium User-Agent: ZohoCN Mail X-Mailer: ZohoCN Mail Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ---- =E5=9C=A8 =E6=98=9F=E6=9C=9F=E5=85=AD, 2020-01-04 19:53:08 Greg Kroah= -Hartman =E6=92=B0=E5=86=99 ---- > On Sat, Jan 04, 2020 at 09:50:43AM +0800, Chengguang Xu wrote: > > ---- =E5=9C=A8 =E6=98=9F=E6=9C=9F=E5=85=AD, 2020-01-04 01:12:13 Pavel= Machek =E6=92=B0=E5=86=99 ---- > > > Hi! > > >=20 > > > > 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). > > >=20 > > > > 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 supe= r_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) { > > >=20 > > > >> blocksize disappeared here. That can't be right. > > >=20 > > > Plus, is this just obfuscated way of saying > > >=20 > > > limit =3D min_not_zero(dquot->dq_dqb.dqb_bsoftlimit, dquot->dq_dqb.= dqb_bhardlimit)? > > >=20 > >=20 > > Please skip this patch from stable list, I'll send a revised patch= to upstream. >=20 > This patch is already in Linus's tree, so you can't send a "revised" > version, only one that applies on top of this one :) >=20 > That being said, I'll go drop this from the stable queues, thanks. > Please let us know when the fixed patch is in Linus's tree and we will > be glad to take both of them. >=20 =20 Hi Greg, Sasha Now the fix patch has been in Linus's tree, you can add below three patches= together to backport list. commit 909110c060f22e6 "f2fs: choose hardlimit when softlimit is larger tha= n hardlimit in f2fs_statfs_project()" commit acdf2172172a511 "f2fs: fix miscounted block limit in f2fs_statfs_pro= ject()" commit bf2cbd3c57159c2 "f2fs: code cleanup for f2fs_statfs_project()" Thanks, Chengguang