linux-yocto/fs/f2fs
Chao Yu 46ef58a80b f2fs: don't over-report free space or inodes in statvfs
[ Upstream commit a920196062 ]

This fixes an analogus bug that was fixed in modern filesystems:
a) xfs in commit 4b8d867ca6 ("xfs: don't over-report free space or
inodes in statvfs")
b) ext4 in commit f87d3af741 ("ext4: don't over-report free space
or inodes in statvfs")
where statfs can report misleading / incorrect information where
project quota is enabled, and the free space is less than the
remaining quota.

This commit will resolve a test failure in generic/762 which tests
for this bug.

generic/762       - output mismatch (see /share/git/fstests/results//generic/762.out.bad)
#    --- tests/generic/762.out   2025-04-15 10:21:53.371067071 +0800
#    +++ /share/git/fstests/results//generic/762.out.bad 2025-05-13 16:13:37.000000000 +0800
#    @@ -6,8 +6,10 @@
#     root blocks2 is in range
#     dir blocks2 is in range
#     root bavail2 is in range
#    -dir bavail2 is in range
#    +dir bavail2 has value of 1539066
#    +dir bavail2 is NOT in range 304734.87 .. 310891.13
#     root blocks3 is in range
#    ...
#    (Run 'diff -u /share/git/fstests/tests/generic/762.out /share/git/fstests/results//generic/762.out.bad'  to see the entire diff)

HINT: You _MAY_ be missing kernel fix:
      XXXXXXXXXXXXXX xfs: don't over-report free space or inodes in statvfs

Cc: stable@kernel.org
Fixes: ddc34e328d ("f2fs: introduce f2fs_statfs_project")
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-07-06 10:57:57 +02:00
..
acl.c
acl.h
checkpoint.c
compress.c
data.c f2fs: fix to detect gcing page in f2fs_is_cp_guaranteed() 2025-06-27 11:07:10 +01:00
debug.c
dir.c f2fs: Introduce linear search for dentries 2025-02-21 13:49:25 +01:00
extent_cache.c f2fs: fix several potential integer overflows in file offsets 2024-10-17 15:21:22 +02:00
f2fs.h f2fs: fix to do sanity check on sbi->total_valid_block_count 2025-06-27 11:07:09 +01:00
file.c f2fs: fix to wait dio completion 2025-02-21 13:50:12 +01:00
gc.c f2fs: fix to avoid use GC_AT when setting gc_mode as GC_URGENT_LOW or GC_URGENT_MID 2024-12-14 19:53:45 +01:00
gc.h
hash.c
inline.c f2fs: Introduce linear search for dentries 2025-02-21 13:49:25 +01:00
inode.c f2fs: don't retry IO for corrupted data scenario 2025-04-25 10:43:29 +02:00
iostat.c
iostat.h
Kconfig
Makefile
namei.c f2fs: prevent kernel warning due to negative i_nlink from corrupted image 2025-06-27 11:07:29 +01:00
node.c f2fs: fix to avoid out-of-bounds access in f2fs_truncate_inode_blocks() 2025-04-25 10:43:30 +02:00
node.h
recovery.c
segment.c f2fs: check curseg->inited before write_sum_page in change_curseg 2024-12-14 19:53:45 +01:00
segment.h f2fs: remove struct segment_allocation default_salloc_ops 2024-12-14 19:53:45 +01:00
shrinker.c
super.c f2fs: don't over-report free space or inodes in statvfs 2025-07-06 10:57:57 +02:00
sysfs.c
verity.c
xattr.c f2fs: reduce expensive checkpoint trigger frequency 2024-10-17 15:21:09 +02:00
xattr.h