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=-10.0 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,USER_AGENT_GIT autolearn=unavailable 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 8532DC433E1 for ; Tue, 23 Jun 2020 21:07:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5178A20663 for ; Tue, 23 Jun 2020 21:07:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592946469; bh=H4g1p8Txj5EXRnPJ0ZgNnkJmqASI8EjsxqgyuYnyGyk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=KQUatj1itbTXwHU4YKXNNYIsjN3QctHWbUswjM5VVXSy5Z/FPIg2PxXp34YeMEO+V LaIHWiqfbxfzHlr/MieDTWZIax0PgAcc+P0KVj2pv4slgY1u0+Wc3s4RMfGXIqOPmB VAZcjaky3OcOQBUpPKjjbpNrkaTNOpUqb6F48NYM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391585AbgFWUfH (ORCPT ); Tue, 23 Jun 2020 16:35:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:57338 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391581AbgFWUfG (ORCPT ); Tue, 23 Jun 2020 16:35:06 -0400 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 DC7392064B; Tue, 23 Jun 2020 20:35:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592944506; bh=H4g1p8Txj5EXRnPJ0ZgNnkJmqASI8EjsxqgyuYnyGyk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p02txnxUhZ1gYb40Y7QWprEdxYZNM7tao7K/sf2B7kp0zFYbQo3D7Gaycsvs7tsna ObVG3Mp6Q2US5rXEmYp6t5HE5nSnVu3Al5v3fs4LJIGUhu3LK9t2RGjrTdYEuXzJcJ p7w9TgkBMW6R+eThi6gD14R5Hzwbk9uqtFIabLY8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Konstantin Khlebnikov , Chao Yu , Jaegeuk Kim , Sasha Levin Subject: [PATCH 4.19 017/206] f2fs: report delalloc reserve as non-free in statfs for project quota Date: Tue, 23 Jun 2020 21:55:45 +0200 Message-Id: <20200623195317.814547634@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200623195316.864547658@linuxfoundation.org> References: <20200623195316.864547658@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Konstantin Khlebnikov [ Upstream commit baaa7ebf25c78c5cb712fac16b7f549100beddd3 ] This reserved space isn't committed yet but cannot be used for allocations. For userspace it has no difference from used space. See the same fix in ext4 commit f06925c73942 ("ext4: report delalloc reserve as non-free in statfs for project quota"). Fixes: ddc34e328d06 ("f2fs: introduce f2fs_statfs_project") Signed-off-by: Konstantin Khlebnikov Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim Signed-off-by: Sasha Levin --- fs/f2fs/super.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 45f8f6ec22a55..9782250c98156 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -1154,7 +1154,8 @@ static int f2fs_statfs_project(struct super_block *sb, limit >>= sb->s_blocksize_bits; if (limit && buf->f_blocks > limit) { - curblock = dquot->dq_dqb.dqb_curspace >> sb->s_blocksize_bits; + curblock = (dquot->dq_dqb.dqb_curspace + + dquot->dq_dqb.dqb_rsvspace) >> sb->s_blocksize_bits; buf->f_blocks = limit; buf->f_bfree = buf->f_bavail = (buf->f_blocks > curblock) ? -- 2.25.1