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.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 EEDCEC433E0 for ; Thu, 18 Jun 2020 02:51:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C24E82083B for ; Thu, 18 Jun 2020 02:51:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592448708; bh=3nkSWgAAPcJChv3MakksNPZN+UPpc4ypgp0uwpNGb5c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=fXOid+asYUYrblJ1WcXMjsq+N6H2DITlkNo/4uyPUHBhvzf6o0zA7VcDtctdvJ5Pt XuSqFExztx7qa7+LLq12fVzPwNau23KPG7pKpyiwK1bpWCU5Ktw2E6S+TjoamH437P aI3zzwzgpuBIOwtxxho+Z6QTGf1VykYytbtq5d0M= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387817AbgFRCvs (ORCPT ); Wed, 17 Jun 2020 22:51:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:34910 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727884AbgFRBIy (ORCPT ); Wed, 17 Jun 2020 21:08:54 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0D8E721D7A; Thu, 18 Jun 2020 01:08:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592442533; bh=3nkSWgAAPcJChv3MakksNPZN+UPpc4ypgp0uwpNGb5c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qLVmMrDVP/M2tb2i+qV4wKgGY769x3RjaabNWibOX1SbPeev9hyh8G688TxP7A82X Ib9IULJw3I687icBR9W5YxfD/bzkzk0rgE++BjkLCP1roEF0w5qk1e6L8QEUnveF8u WbTB9ivPQmmWsKE3vWgKVLfICnaRzAyNWxiyVq4Y= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Konstantin Khlebnikov , Chao Yu , Jaegeuk Kim , Sasha Levin , linux-f2fs-devel@lists.sourceforge.net Subject: [PATCH AUTOSEL 5.7 036/388] f2fs: report delalloc reserve as non-free in statfs for project quota Date: Wed, 17 Jun 2020 21:02:13 -0400 Message-Id: <20200618010805.600873-36-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200618010805.600873-1-sashal@kernel.org> References: <20200618010805.600873-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 f2dfc21c6abb..c5e8cb31626f 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -1292,7 +1292,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