From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6C77C352A3 for ; Fri, 7 Feb 2020 10:19:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AA554214AF for ; Fri, 7 Feb 2020 10:19:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581070778; bh=E6Bhpu7PeadDR+lnSXCZdRb1H/HcVZY2jmhLQfHKHNg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=LfAW2hx/BZl72r35ytdFM2e7JBUeYUB18T2o3oB//9ZZbBp2B6RiY4zNcXz26iMJ0 h4X62UNou0/w4ODzhL2zenlgFMo+vruwbqpO5OAqy5n9btX+poLZ/cNUEmuV9mD5g5 9zEmePoyL5hoIBc5X9B2bFS3mxEXkTy1VTxBKIyw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726901AbgBGKTi (ORCPT ); Fri, 7 Feb 2020 05:19:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:34998 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726587AbgBGKTi (ORCPT ); Fri, 7 Feb 2020 05:19:38 -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 49EE220838; Fri, 7 Feb 2020 10:19:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581070776; bh=E6Bhpu7PeadDR+lnSXCZdRb1H/HcVZY2jmhLQfHKHNg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IBIPcZrUPuEJRxdGdR2zitjAgr4tCGwahxSRTi44HMOpMwMsBIyghInx2g7K1OCzt r6FIouey/1zVdHwkATxbGqY9ImByO4KTgLc/xzd2Kfb0oxvaC1RFZ0kWeX/04fCzh7 +HaVXdqiriiaLobngHWMzqgKg7XhVhE1Wr4DnAVk= Date: Fri, 7 Feb 2020 11:19:34 +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: <20200207101934.GA635415@kroah.com> References: <20200102220029.183913184@linuxfoundation.org> <20200102220035.294585461@linuxfoundation.org> <20200103171213.GC14328@amd> <16f6e3f5bbe.d291a05d38838.5222280714928609391@mykernel.net> <20200104115308.GA1296856@kroah.com> <1700010cc3e.12eb876364380.7472123035435503364@mykernel.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1700010cc3e.12eb876364380.7472123035435503364@mykernel.net> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Sat, Feb 01, 2020 at 05:24:25PM +0800, Chengguang Xu wrote: > ---- 在 星期六, 2020-01-04 19:53:08 Greg Kroah-Hartman 撰写 ---- > > 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. > > > > > 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 than hardlimit in f2fs_statfs_project()" > commit acdf2172172a511 "f2fs: fix miscounted block limit in f2fs_statfs_project()" > commit bf2cbd3c57159c2 "f2fs: code cleanup for f2fs_statfs_project()" All now queued up, thanks for letting us know. greg k-h