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=-9.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT 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 703B8C433E2 for ; Thu, 18 Jun 2020 01:26:36 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4044B20776; Thu, 18 Jun 2020 01:26:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sourceforge.net header.i=@sourceforge.net header.b="OmxRJz/E"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sf.net header.i=@sf.net header.b="fz2ZptKH"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="nN/JeaZo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4044B20776 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-f2fs-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1jljK7-0005O3-Sr; Thu, 18 Jun 2020 01:26:35 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jljK6-0005Nw-LC for linux-f2fs-devel@lists.sourceforge.net; Thu, 18 Jun 2020 01:26:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=TyDaALy7b9GA9AqxQCMPmlpaC/NOCq8JlC/FAJ11fSk=; b=OmxRJz/Eg9bE5lzXiCd3LuHzrD qToPtZd5Z7gdl8JMHPOVkJanRSg7PNJAachZP/SVUSzan1pnzaM8gDYYMiJrm1YTd7yIBnQKGZISn ekur30X9gUigqUpYPLxd7BO1PImvx/Wjgz6xA1/a/6E/di9e90M28ArjJYgLpaMDLxQM=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=TyDaALy7b9GA9AqxQCMPmlpaC/NOCq8JlC/FAJ11fSk=; b=fz2ZptKH14jitl44yewxgqv44Y LSwJN74I8Gi11cC958yp5VAv2WXhq4NO3vtAgkr4iAHmiJoXApz56mz11lcGxZK8PIR5Pv0wN3MEh oJkC7sVqETFw6LXHurKNXVtsVHhAdvx9arP99gsMw00TA3dVbwfBaEGveXAGo3ilfHNY=; Received: from mail.kernel.org ([198.145.29.99]) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1jljK5-0072Ck-H0 for linux-f2fs-devel@lists.sourceforge.net; Thu, 18 Jun 2020 01:26:34 +0000 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 3113E20776; Thu, 18 Jun 2020 01:26:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592443581; bh=nf9nzU35c55tX/xzhfgZMXmzLhWaHU1Nh+8LWMvq+ZM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nN/JeaZoC65itd9bfcNrngaSXpebAWzuAiZez1XCHoKuS8qF2zCDD7CbKW91GMEIE PG30Z0cCGmzgQfyrhrCCVYbDyHz3v93dYcIcfhF6uajhW6K8/QmoER67JxGT50rBh/ eZiWt1uJJCxFAEyudg6KoYrT3nBKGG5nq2Ug6sDI= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Date: Wed, 17 Jun 2020 21:24:28 -0400 Message-Id: <20200618012600.608744-16-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200618012600.608744-1-sashal@kernel.org> References: <20200618012600.608744-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-Headers-End: 1jljK5-0072Ck-H0 Subject: [f2fs-dev] [PATCH AUTOSEL 4.14 016/108] f2fs: report delalloc reserve as non-free in statfs for project quota X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Konstantin Khlebnikov , Jaegeuk Kim , linux-f2fs-devel@lists.sourceforge.net, Sasha Levin Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net 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 2d021a33914a..89319c352406 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -918,7 +918,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 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel