diff options
| author | Chao Yu <yuchao0@huawei.com> | 2016-07-06 14:13:07 +0800 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-04-13 12:33:51 +0200 |
| commit | f782f3369565f5a816da729ffe4b519670c33e22 (patch) | |
| tree | ac450566d112e9c5c8d5fc0e06cb07db458514fd | |
| parent | ddbdd9a5ac65fc3a042f4e5087ba4b34a2f8217a (diff) | |
| download | android_kernel_m2note-f782f3369565f5a816da729ffe4b519670c33e22.tar.gz | |
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>
| -rw-r--r-- | fs/f2fs/super.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index a141bb33d..838531904 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -800,7 +800,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; |
