alistair23-linux/fs/f2fs
Jaegeuk Kim 1362b5e347 f2fs: fix wrong calculation on f_files in statfs
In f2fs_statfs(), f_files should be the total number of available inodes
instead of the currently allocated inodes.
So, this patch should resolve the reported bug below.

Note that, showing 10% usage is not a bug, since f2fs reveals whole volume size
as much as possible and shows the space overhead as *used*.
This policy is fair enough with respect to other file systems.

<Reported Bug>
(loop0 is backed by 1GiB file)

$ mkfs.f2fs /dev/loop0

F2FS-tools: Ver: 1.1.0 (2012-12-11)
Info: sector size = 512
Info: total sectors = 2097152 (in 512bytes)
Info: zone aligned segment0 blkaddr: 512
Info: format successful

$ mount /dev/loop0 mnt/

$ df mnt/
Filesystem     1K-blocks  Used Available Use% Mounted on
/dev/loop0       1046528 98312    929784  10%
/home/zeta/linux-devel/mtd-bench/mnt

$ df mnt/ -i
Filesystem     Inodes   IUsed  IFree IUse% Mounted on
/dev/loop0       1 -465918 465919     - /home/zeta/linux-devel/mtd-bench/mnt

Notice IUsed is negative. Also, 10% usage on a fresh f2fs seems too
much to be correct.

Reported-and-Tested-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
2012-12-26 10:39:51 +09:00
..
acl.c f2fs: resolve build failures 2012-12-11 13:43:43 +09:00
acl.h f2fs: adjust kernel coding style 2012-12-11 13:43:42 +09:00
checkpoint.c f2fs: adjust kernel coding style 2012-12-11 13:43:42 +09:00
data.c f2fs: cleanup the f2fs_bio_alloc routine 2012-12-11 13:43:45 +09:00
debug.c f2fs: adjust kernel coding style 2012-12-11 13:43:42 +09:00
dir.c f2fs: fix tracking parent inode number 2012-12-11 13:43:45 +09:00
f2fs.h f2fs: fix tracking parent inode number 2012-12-11 13:43:45 +09:00
file.c f2fs: remove unused variable 2012-12-11 13:43:44 +09:00
gc.c f2fs: remove unneeded initialization 2012-12-11 13:43:44 +09:00
gc.h f2fs: adjust kernel coding style 2012-12-11 13:43:42 +09:00
hash.c f2fs: adjust kernel coding style 2012-12-11 13:43:42 +09:00
inode.c f2fs: fix tracking parent inode number 2012-12-11 13:43:45 +09:00
Kconfig f2fs: resolve build failures 2012-12-11 13:43:43 +09:00
Makefile f2fs: update Kconfig and Makefile 2012-12-11 13:43:42 +09:00
namei.c f2fs: make use of GFP_F2FS_ZERO for setting gfp_mask 2012-12-11 13:43:44 +09:00
node.c f2fs: fix the compiler warning for uninitialized use of variable 2012-12-11 13:43:43 +09:00
node.h f2fs: adjust kernel coding style 2012-12-11 13:43:42 +09:00
recovery.c f2fs: adjust kernel coding style 2012-12-11 13:43:42 +09:00
segment.c f2fs: remove set_page_dirty for atomic f2fs_end_io_write 2012-12-26 10:39:51 +09:00
segment.h f2fs: cleanup the f2fs_bio_alloc routine 2012-12-11 13:43:45 +09:00
super.c f2fs: fix wrong calculation on f_files in statfs 2012-12-26 10:39:51 +09:00
xattr.c f2fs: resolve build failures 2012-12-11 13:43:43 +09:00
xattr.h f2fs: adjust kernel coding style 2012-12-11 13:43:42 +09:00