lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250304192041.4048741-1-daeho43@gmail.com>
Date: Tue,  4 Mar 2025 11:20:41 -0800
From: Daeho Jeong <daeho43@...il.com>
To: linux-kernel@...r.kernel.org,
	linux-f2fs-devel@...ts.sourceforge.net,
	kernel-team@...roid.com
Cc: Daeho Jeong <daehojeong@...gle.com>
Subject: [PATCH] f2fs: subtract current_reserved_blocks from total

From: Daeho Jeong <daehojeong@...gle.com>

current_reserved_blocks is not allowed to utilize. For some zoned
storage devices, vendors will provide extra space which was used for
device level GC than specs and we will use this space for filesystem
level GC. This extra space should not be shown to users, otherwise,
users will see not standardized size number like 530GB, not 512GB.

Signed-off-by: Daeho Jeong <daehojeong@...gle.com>
---
 fs/f2fs/super.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 19b67828ae32..c346dcc2518a 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -1833,10 +1833,9 @@ static int f2fs_statfs(struct dentry *dentry, struct kstatfs *buf)
 	buf->f_type = F2FS_SUPER_MAGIC;
 	buf->f_bsize = sbi->blocksize;
 
-	buf->f_blocks = total_count - start_count;
-
 	spin_lock(&sbi->stat_lock);
 
+	buf->f_blocks = total_count - start_count - sbi->current_reserved_blocks;
 	user_block_count = sbi->user_block_count;
 	total_valid_node_count = valid_node_count(sbi);
 	avail_node_count = sbi->total_node_count - F2FS_RESERVED_NODE_NUM;
-- 
2.48.1.711.g2feabab25a-goog


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ