2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/fs/f2fs
Chao Yu ba8dac350f f2fs: fix to zero post-eof page
fstest reports a f2fs bug:

generic/363 42s ... [failed, exit status 1]- output mismatch (see /share/git/fstests/results//generic/363.out.bad)
    --- tests/generic/363.out   2025-01-12 21:57:40.271440542 +0800
    +++ /share/git/fstests/results//generic/363.out.bad 2025-05-19 19:55:58.000000000 +0800
    @@ -1,2 +1,78 @@
     QA output created by 363
     fsx -q -S 0 -e 1 -N 100000
    +READ BAD DATA: offset = 0xd6fb, size = 0xf044, fname = /mnt/f2fs/junk
    +OFFSET      GOOD    BAD     RANGE
    +0x1540d     0x0000  0x2a25  0x0
    +operation# (mod 256) for the bad data may be 37
    +0x1540e     0x0000  0x2527  0x1
    ...
    (Run 'diff -u /share/git/fstests/tests/generic/363.out /share/git/fstests/results//generic/363.out.bad'  to see the entire diff)
Ran: generic/363
Failures: generic/363
Failed 1 of 1 tests

The root cause is user can update post-eof page via mmap [1], however, f2fs
missed to zero post-eof page in below operations, so, once it expands i_size,
then it will include dummy data locates previous post-eof page, so during
below operations, we need to zero post-eof page.

Operations which can include dummy data after previous i_size after expanding
i_size:
- write
- mapwrite [1]
- truncate
- fallocate
 * preallocate
 * zero_range
 * insert_range
 * collapse_range
- clone_range (doesn’t support in f2fs)
- copy_range (doesn’t support in f2fs)

[1] https://man7.org/linux/man-pages/man2/mmap.2.html 'BUG section'

Cc: stable@kernel.org
Signed-off-by: Chao Yu <chao@kernel.org>
Reviewed-by: Zhiguo Niu <zhiguo.niu@unisoc.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2025-06-18 21:35:29 +00:00
..
acl.c f2fs: Pass a folio to f2fs_getxattr() 2025-04-28 15:26:42 +00:00
acl.h f2fs: Pass folios to f2fs_init_acl() 2025-04-28 15:26:41 +00:00
checkpoint.c f2fs: introduce is_{meta,node}_folio 2025-05-28 16:03:26 +00:00
compress.c f2fs: clean up to check bi_status w/ BLK_STS_OK 2025-05-28 16:03:39 +00:00
data.c f2fs: clean up to check bi_status w/ BLK_STS_OK 2025-05-28 16:03:39 +00:00
debug.c f2fs: keep POSIX_FADV_NOREUSE ranges 2025-02-13 17:58:31 +00:00
dir.c f2fs: Pass a folio to f2fs_update_inode() 2025-04-28 15:26:47 +00:00
extent_cache.c f2fs: Convert dnode_of_data->node_page to node_folio 2025-04-28 15:26:47 +00:00
f2fs.h f2fs: introduce is_{meta,node}_folio 2025-05-28 16:03:26 +00:00
file.c f2fs: fix to zero post-eof page 2025-06-18 21:35:29 +00:00
gc.c f2fs-for-6.16-rc1 2025-05-30 08:40:25 -07:00
gc.h f2fs: decrease spare area for pinned files for zoned devices 2024-11-01 01:19:00 +00:00
hash.c f2fs: don't use casefolded comparison for "." and ".." 2022-05-17 11:19:23 -07:00
inline.c f2fs: drop usage of folio_index 2025-05-06 15:46:55 +00:00
inode.c f2fs: remove unused sbi argument from checksum functions 2025-05-27 23:52:35 +00:00
iostat.c f2fs: add async reset zone command support 2023-06-12 13:04:09 -07:00
iostat.h f2fs: use iostat_lat_type directly as a parameter in the iostat_update_and_unbind_ctx() 2023-02-07 10:39:28 -08:00
Kconfig f2fs: switch to using the crc32 library 2024-12-01 17:23:02 -08:00
Makefile f2fs: separate out iostat feature 2021-08-23 10:25:51 -07:00
namei.c f2fs: fix to correct check conditions in f2fs_cross_rename 2025-05-28 16:05:25 +00:00
node.c f2fs: Fix __write_node_folio() conversion 2025-06-10 14:52:21 +00:00
node.h f2fs: Pass a folio to set_nid() 2025-04-28 15:26:47 +00:00
recovery.c f2fs: Convert dnode_of_data->node_page to node_folio 2025-04-28 15:26:47 +00:00
segment.c f2fs: fix to skip f2fs_balance_fs() if checkpoint is disabled 2025-05-28 16:04:15 +00:00
segment.h f2fs: add ckpt_valid_blocks to the section entry 2025-05-28 15:58:49 +00:00
shrinker.c f2fs: handle error cases of memory donation 2025-05-06 15:46:55 +00:00
super.c f2fs: use d_inode(dentry) cleanup dentry->d_inode 2025-05-28 16:05:22 +00:00
sysfs.c f2fs: sysfs: export linear_lookup in features directory 2025-05-06 15:46:54 +00:00
verity.c f2fs-6.12-rc1 2024-09-24 15:12:38 -07:00
xattr.c f2fs: Pass a folio to inline_xattr_addr() 2025-04-28 15:26:43 +00:00
xattr.h f2fs: Pass a folio to f2fs_getxattr() 2025-04-28 15:26:42 +00:00