From b992ad3197abe4e06e19d864f2120e82b553ffc6 Mon Sep 17 00:00:00 2001 From: Cliff Chen Date: Thu, 19 Jul 2018 16:27:16 +0800 Subject: [PATCH] f2fs: modify f_blocks for statfs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The f_blocks of statfs include file system overhead,it is not normal usage of Posix. Change-Id: If481626b08c05290626938586e2dc721690f1a91 Signed-off-by: Cliff Chen --- 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 14f033e1ab42..9e53a5a00f8d 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -1216,7 +1216,8 @@ 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; + /* f_blocks should not include overhead of filesystem */ + buf->f_blocks = user_block_count; buf->f_bfree = user_block_count - valid_user_blocks(sbi) - sbi->current_reserved_blocks; if (unlikely(buf->f_bfree <= sbi->unusable_block_count))