[f2fs-dev] [syzbot] [f2fs?] kernel BUG in f2fs_truncate_hole (2)

2025-08-20 Thread syzbot
Hello, syzbot found the following issue on: HEAD commit:90d970cade8e Merge tag 'ata-ata-6.17-rc2' of git://git.ker.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=118fb3a258 kernel config: https://syzkaller.appspot.com/x/.config?x=3f81850843b877ed das

[f2fs-dev] [PATCH] f2fs: skip checkpoint for compressed file write

2025-08-20 Thread Jiucheng Xu via B4 Relay via Linux-f2fs-devel
(ret > 0 && may_need_sync) - ret = generic_write_sync(iocb, ret); - /* If buffered IO was forced, flush and drop the data from * the page cache to preserve O_DIRECT semantics */ --- base-commit: 3ea4ad0a1df0bcbfd5ccdcea56d57ca4678ae2a8 change-id:

Re: [f2fs-dev] [PATCH v3] f2fs: fix CURSEG_HOT_DATA left space check

2025-08-20 Thread Jaegeuk Kim via Linux-f2fs-devel
On 08/20, Chao Yu wrote: > On 8/6/25 20:32, mason.zhang wrote: > > This fix combines the space check for data_blocks and dent_blocks when > > verifying HOT_DATA segment capacity, preventing potential insufficient > > space issues during checkpoint. > > > > Fixes: bf34c93d2645 ("f2fs: check curseg

[f2fs-dev] [PATCH v3 12/13] inject.f2fs: add members in inject_node

2025-08-20 Thread Sheng Yong
From: Sheng Yong This patch adds new members in inject_node to inject inode: * i_ext.fofs: extent fofs * i_ext.blk_addr: extent blk_addr * i_ext.len: extent len * i_inline_xattr_size: inline xattr size * i_compr_blocks: compression blocks Signed-off-by: Sheng Yong --- v3: * fix print forma

[f2fs-dev] [PATCH v3 13/13] inject.f2fs: add member `filename' in inject_dentry

2025-08-20 Thread Sheng Yong
From: Sheng Yong This patch adds a new member `filename' in inject_dentry to inject dentry filename. The dentry is specified by nid option. Note that '.' and '..' dentries are special, because they are not in the parent directory of nid. So this patch also adds a new option `--dots' to inject th

[f2fs-dev] [PATCH v3 09/13] inject.f2fs: fix and cleanup parsing numeric options

2025-08-20 Thread Sheng Yong
From: Sheng Yong This patch fixes: * parsing hex optarg of --idx option * converting -1 to 0xff...ff of --val option and do a little cleanup of converting string to a long integer. Signed-off-by: Sheng Yong --- fsck/inject.c | 32 +--- 1 file changed, 17 inserti

[f2fs-dev] [PATCH v3 10/13] inject.f2fs: add members in inject_cp

2025-08-20 Thread Sheng Yong
From: Sheng Yong The following members are added to inject more fields in cp: * next_blkaddr: inject fsync dnodes An error is returned if no fsync dnode is found. Furthermore, the injection is not supported on a zoned device. This is because fsync dnodes must remains at the end of current

[f2fs-dev] [PATCH v3 03/13] f2fs-tools: cleanup {nid|segno}_in_journal

2025-08-20 Thread Sheng Yong
From: Sheng Yong Signed-off-by: Sheng Yong --- fsck/f2fs.h | 4 ++-- fsck/mount.c | 14 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/fsck/f2fs.h b/fsck/f2fs.h index 187e73cf9aec..4c6c0c48b9ee 100644 --- a/fsck/f2fs.h +++ b/fsck/f2fs.h @@ -504,9 +504,9 @@ struc

[f2fs-dev] [PATCH v3 05/13] dump.f2fs: print more info

2025-08-20 Thread Sheng Yong
From: Sheng Yong dump.f2fs shows more info: * nat entry version * sit entry mtime Signed-off-by: Sheng Yong --- fsck/dump.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/fsck/dump.c b/fsck/dump.c index 10df7e593bfe..21de2acf80b5 100644 --- a/fsck/dump.c +++

[f2fs-dev] [PATCH v3 08/13] inject.f2fs: fix injection on zoned device

2025-08-20 Thread Sheng Yong
From: Sheng Yong Because node and data blocks are updated out of place on zoned device, sit_area_bitmap and main_area_bitmap are required to record which blocks are allocated, sit should be flushed to reflect changes in block address, and checkpoint should be rewritten to update cursegs. Signed-

[f2fs-dev] [PATCH v3 02/13] f2fs-tools: add option N to answer no for all questions

2025-08-20 Thread Sheng Yong
From: Sheng Yong In some scenario, such as autotest, it is not expected to answer question from fsck or dump. To simply answer no to all these questions, this patch adds an option `N' to do that. Signed-off-by: Sheng Yong --- v3: update manual --- fsck/dump.c | 3 +++ fsck/fsck.c

[f2fs-dev] [PATCH v3 11/13] inject.f2fs: add member `feature' in inject_sb

2025-08-20 Thread Sheng Yong
From: Sheng Yong This patch adds a new member `feature' in inject_sb to inject features. Signed-off-by: Sheng Yong --- fsck/inject.c | 5 + man/inject.f2fs.8 | 3 +++ 2 files changed, 8 insertions(+) diff --git a/fsck/inject.c b/fsck/inject.c index 272a4a64dc05..cb348b3ba067 100644 --

[f2fs-dev] [PATCH v3 06/13] f2fs-tools: add and export lookup_sit_in_journal

2025-08-20 Thread Sheng Yong
From: Sheng Yong Add lookup_sit_in_journal() which is similar to lookup_nat_in_journal() to get the raw sit entry from journal if exist. Signed-off-by: Sheng Yong --- fsck/f2fs.h | 2 ++ fsck/mount.c | 18 ++ 2 files changed, 20 insertions(+) diff --git a/fsck/f2fs.h b/fsck/

[f2fs-dev] [PATCH v3 04/13] fsck.f2fs: fix invalidate checkpoint

2025-08-20 Thread Sheng Yong
From: Sheng Yong If one cp is invalidate, set CP_FSCK_FLAG to allow fsck_verify() to fixing cp at the end of check. Signed-off-by: Sheng Yong --- fsck/f2fs.h | 6 ++ fsck/mount.c | 11 --- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/fsck/f2fs.h b/fsck/f2fs.h i

[f2fs-dev] [PATCH v3 07/13] inject.f2fs: fix injecting sit/nat in journal

2025-08-20 Thread Sheng Yong
From: Sheng Yong Previously when injecting sit/nat entry, we only inject SIT/NAT pack. If the valid target is in journal, the injection has no effect. So we have to check whether the valid target is in journal, and inject the target at its valid position. Signed-off-by: Sheng Yong --- v3: * add

[f2fs-dev] [PATCH v3 00/13] f2fs-tools & inject.f2fs: bugfix and new injections

2025-08-20 Thread Sheng Yong
Hi, all, Since we have not yet determined how to check the test result properly, I split patchset v2 into two parts on Chao's suggestion. This is the first part which contains some fixes/cleanups for f2fs-tools, and adds new injections for inject.f2fs. Changes from last version are also updated i

[f2fs-dev] [PATCH v3 01/13] fsck.f2fs: do not finish/reset zone if dry-run is true

2025-08-20 Thread Sheng Yong
From: Sheng Yong Signed-off-by: Sheng Yong --- lib/libf2fs_zoned.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libf2fs_zoned.c b/lib/libf2fs_zoned.c index 6730bba0da82..92791a768807 100644 --- a/lib/libf2fs_zoned.c +++ b/lib/libf2fs_zoned.c @@ -429,7 +429,7 @@

[f2fs-dev] [PATCH v2] f2fs: Use allocate_section_policy to control write priority in multi-devices setups

2025-08-20 Thread Liao Yuanhong via Linux-f2fs-devel
Introduces two new sys nodes: allocate_section_hint and allocate_section_policy. The allocate_section_hint identifies the boundary between devices, measured in sections; it defaults to the end of the device for single storage setups, and the end of the first device for multiple storage setups. The

[f2fs-dev] [PATCH v4] f2fs:fix missing space reclamation during the recovery process

2025-08-20 Thread Wang Xiaojun via Linux-f2fs-devel
This patch fixes missing space reclamation during the recovery process. In the following scenarios, F2FS cannot reclaim truncated space. case 1: write file A, size is 1G | CP | truncate A to 1M | fsync A | SPO case 2: CP | write file A, size is 1G | fsync A | truncate A to 1M | fsync A |SPO Duri