Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp19545061ybl; Sat, 4 Jan 2020 03:54:05 -0800 (PST) X-Google-Smtp-Source: APXvYqxoA9T+vaCnK/sTTZaF9cuGhfulRnji3A0V0zCIIuIQtFd2sx8sxP0O493kLZDSRmi83Grj X-Received: by 2002:a05:6830:10c6:: with SMTP id z6mr110091749oto.203.1578138845368; Sat, 04 Jan 2020 03:54:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578138845; cv=none; d=google.com; s=arc-20160816; b=NwCnFLbfEWpfB5vVrX4ePJb8dxZszm41QrCxg/Q626AbnNQ17GlKdzFHvlQNxAGMCb 24h/p7VBGoAIsw2yfH8FWKV7kCFRE7YI1nrxFb5gWXGYgTQCsqCTNvGY32y9/hA96Jvj oXB+2J94ZAtnNj36M8UoXSyc3gEUVzU5sr5ZecY8KlAqtreZM0djOBnRpyq8Fkdo+q9N ZN4LIgpLpDByzawmsGZB33J1L/vXpVnX2TT1sCnmlWMoUPA/EwzX1KPzOmlzngyrT9ww N8Q7u43QYCiB1e5GzDMWAJN0s4FQC6nkCJsq66NpeJxVD3sOxmfkLwUdeAWDvKoniLre zFaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=zzR9gnNt7ccvOSHLwmPAZUpu+ETh0cn46whBZF1HyRc=; b=O148ANY3NPKdf1SgZsKaIXUXkAucZt7TneUkLOMIoHgQRXV2IA9/WZgO+9fixN2SzQ m2sKh17TVjGKzm90eoeVM0+uEOupieQgACCdtKf73zKclD5clur6ZFT7PppoSiVP4zCI 5xgldaeXT2ocjZwnWo6/P4yHKVB8bHtjjd68k9mUHgLHL7KM/oEXmtG51HbPyZFJF2VE BxUhlgIg9G0Vv12YotkSxwB98CqYOmlWLd6tGIsU9OvVjklyenYOUOl1fQCOeMBcCDr3 iV++Oq/PW7fK11ohbt8+V5/jG2xLqFCuWWkXquz/ryS14oQQdVoIIF2jSw1hxOhNfgL+ hmtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=s+7E9Yp0; 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 m20si28184750otk.279.2020.01.04.03.53.53; Sat, 04 Jan 2020 03:54:05 -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=@kernel.org header.s=default header.b=s+7E9Yp0; 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 S1725883AbgADLxN (ORCPT + 99 others); Sat, 4 Jan 2020 06:53:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:44532 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725796AbgADLxM (ORCPT ); Sat, 4 Jan 2020 06:53:12 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0149A24649; Sat, 4 Jan 2020 11:53:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578138790; bh=/zeTUOLPTnr8cd2pSmtDmYm5FZFtcaNSMd3zUfMLuZM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=s+7E9Yp0eTdm44eKkGtBoeqw6sqgYg8JOj9PgeNZ9OGjrdWq+WCgPTu0y7EGV8zvI Tol8GWIkZkFLgZH6fCTuWO0jxpFBnlTw7y6dbm9SaBAOPc35dCD6DzUFAX2rRpEtdW wtUyfwMRn4lr6ykgjL03wt4RYJjJC+qxYaTgqR6Q= Date: Sat, 4 Jan 2020 12:53:08 +0100 From: Greg Kroah-Hartman To: Chengguang Xu Cc: Pavel Machek , linux-kernel , stable , 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: <20200104115308.GA1296856@kroah.com> References: <20200102220029.183913184@linuxfoundation.org> <20200102220035.294585461@linuxfoundation.org> <20200103171213.GC14328@amd> <16f6e3f5bbe.d291a05d38838.5222280714928609391@mykernel.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <16f6e3f5bbe.d291a05d38838.5222280714928609391@mykernel.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jan 04, 2020 at 09:50:43AM +0800, Chengguang Xu wrote: > ---- 在 星期六, 2020-01-04 01:12:13 Pavel Machek 撰写 ---- > > Hi! > > > > > From: Chengguang Xu > > > > > > [ Upstream commit 909110c060f22e65756659ec6fa957ae75777e00 ] > > > > > > 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. > > > > > > 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(-) > > > > > > 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); > > > > > > - limit = (dquot->dq_dqb.dqb_bsoftlimit ? > > > - dquot->dq_dqb.dqb_bsoftlimit : > > > - dquot->dq_dqb.dqb_bhardlimit) >> sb->s_blocksize_bits; > > > + limit = 0; > > > + if (dquot->dq_dqb.dqb_bsoftlimit) > > > + limit = dquot->dq_dqb.dqb_bsoftlimit; > > > + if (dquot->dq_dqb.dqb_bhardlimit && > > > + (!limit || dquot->dq_dqb.dqb_bhardlimit < limit)) > > > + limit = 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 = min_not_zero(dquot->dq_dqb.dqb_bsoftlimit, dquot->dq_dqb.dqb_bhardlimit)? > > > > Please skip this patch from stable list, I'll send a revised patch to upstream. 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 :) 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. greg k-h