Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp446470ybv; Fri, 7 Feb 2020 02:21:11 -0800 (PST) X-Google-Smtp-Source: APXvYqySS2pGYSjO++U4aJAiHhBc05VK+6K6f1gagONcelc1C93pjyiGtvz0uiB3czNMwHSQyG0p X-Received: by 2002:a54:440e:: with SMTP id k14mr1524914oiw.160.1581070871699; Fri, 07 Feb 2020 02:21:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581070871; cv=none; d=google.com; s=arc-20160816; b=tqDJHYmsdWOH0EhC3V2bl3YRQ0TyeHioa28rp5X2A10hKYWmxI0Ofd2b6vNXZZRDBT JoBT1VM+oLwqQMin/JufzKwzIbg62zYRdP9HtrgrIuObc7Kpo1asgy2yBJ0kMhucaNb4 CpOJZTzltGGCwSHi4uLPbHMArvb/LVyaTKTpKWvgQMP61gUMXqCQz4mBuAyH1nW41CS2 OuK5Il5i/04d4oyFzob5EdEQKFMxAK1tVRo9E3WY1EGkKwp2g4xct8DYNvgcOmr9jxcs yBMQhEKttwCKBgl62RTtxXT+I70sJe84Vxz+Xj48o+3uktp1pm2xvnp2CK1uJJCrEHcV Q59w== 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=DjUoZISSJg9KaDkcM6qUNMxyYH8F11CsgzI++ull1bc=; b=S5ioeyBxwB8MsvqLMIIDMpCiq5QJJ4Tdv+DbeuDjz7m8ZXQPQFhgbvmENnKrdIqQst O3zYtwIJec1X25/J5xOpuwqhSYfV+AHu9uzKmv6g81C/S2xtB7xSJW+HcmOQxjuDoFMc qPkQgIJv/eOZi4Jhl3Ve5Hhbqo7Mlufk6wmrtwOpgaFULdyY0rO/qsVcBGLnc0U/cjPS K/RHtKQoAoCxlqE9f35lwVWJXjxSpYVkx9ZDyTqpUKM5DBYGus8BDVkYUHFoDZyGLiWz EJ3Xl6eG1TA/H4RrSZw7RgtbMraOH8vJXa59l0eFiGbjwb7cjTlPA+x4w8+sQWD/81I8 xEVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IBIPcZrU; 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 j16si1484395otq.23.2020.02.07.02.20.59; Fri, 07 Feb 2020 02:21:11 -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=IBIPcZrU; 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 S1727009AbgBGKTi (ORCPT + 99 others); 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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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