aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/super.c
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2016-07-06 14:13:07 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2016-07-08 10:33:32 -0700
commit3e6d0b4d9c1cd3bbe5bacbf9d6de682be2bce8e4 (patch)
treecc40078790713663ae5c3d897265695707517ffe /fs/f2fs/super.c
parentf2fs: use percpu_rw_semaphore (diff)
downloadlinux-dev-3e6d0b4d9c1cd3bbe5bacbf9d6de682be2bce8e4.tar.xz
linux-dev-3e6d0b4d9c1cd3bbe5bacbf9d6de682be2bce8e4.zip
f2fs: fix incorrect f_bfree calculation in ->statfs
As manual described, f_bfree indicates total free blocks in fs, in f2fs, it includes two parts: visible free blocks and over-provision blocks. This patch corrrects the calculation. fsblkcnt_t f_bfree; /* free blocks in fs */ Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/super.c')
-rw-r--r--fs/f2fs/super.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 2bac9171d2c3..edd1b356d667 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -816,7 +816,7 @@ static int f2fs_statfs(struct dentry *dentry, struct kstatfs *buf)
buf->f_bsize = sbi->blocksize;
buf->f_blocks = total_count - start_count;
- buf->f_bfree = buf->f_blocks - valid_user_blocks(sbi) - ovp_count;
+ buf->f_bfree = user_block_count - valid_user_blocks(sbi) + ovp_count;
buf->f_bavail = user_block_count - valid_user_blocks(sbi);
buf->f_files = sbi->total_node_count - F2FS_RESERVED_NODE_NUM;