Re: [f2fs-dev] [PATCH v3] f2fs: compress: fix UAF of f2fs_inode_info in f2fs_free_dic

2025-06-10 Thread Chao Yu via Linux-f2fs-devel
On 6/11/25 14:41, Zhiguo Niu wrote: > Chao Yu 于2025年6月11日周三 14:07写道: >> >> On 6/11/25 00:08, Jaegeuk Kim wrote: >>> Hi Zhiguo, >>> >>> This patch causes CPU hang when running fsstress on >>> compressed/non-compressed >>> files. Please check. >> >> Oh, seems it may cause below deadlock: >> >> CPU0

Re: [f2fs-dev] [PATCH v3] f2fs: compress: fix UAF of f2fs_inode_info in f2fs_free_dic

2025-06-10 Thread Zhiguo Niu
Chao Yu 于2025年6月11日周三 14:47写道: > > On 6/11/25 14:41, Zhiguo Niu wrote: > > Chao Yu 于2025年6月11日周三 14:07写道: > >> > >> On 6/11/25 00:08, Jaegeuk Kim wrote: > >>> Hi Zhiguo, > >>> > >>> This patch causes CPU hang when running fsstress on > >>> compressed/non-compressed > >>> files. Please check. > >

Re: [f2fs-dev] [PATCH v3] f2fs: compress: fix UAF of f2fs_inode_info in f2fs_free_dic

2025-06-10 Thread Chao Yu via Linux-f2fs-devel
On 6/11/25 00:08, Jaegeuk Kim wrote: > Hi Zhiguo, > > This patch causes CPU hang when running fsstress on compressed/non-compressed > files. Please check. Oh, seems it may cause below deadlock: CPU0 process A - spin_lock(i_lock) software IRQ - end_io - igrab - spin_lock(i_lock) Thanks, > >

[f2fs-dev] [RFC PATCH v2 25/32] tests: add fsck testcase of fixing sum entry ofs_in_node

2025-06-10 Thread Sheng Yong
From: Sheng Yong Signed-off-by: Sheng Yong --- tests/f_ssa_bad_ofs_in_node/README| 5 tests/f_ssa_bad_ofs_in_node/expect.in | 3 +++ tests/f_ssa_bad_ofs_in_node/script| 36 +++ 3 files changed, 44 insertions(+) create mode 100644 tests/f_ssa_bad_ofs_in_no

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

2025-06-10 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] [RFC PATCH v2 10/32] inject.f2fs: add members in inject_cp

2025-06-10 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. However, the injection is not supported on zoned device. This is because fsync dnodes must remains at the end of current warm node

[f2fs-dev] [RFC PATCH v2 06/32] f2fs-tools: add and export lookup_sit_in_journal

2025-06-10 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] [RFC PATCH v2 04/32] fsck.f2fs: fix invalidate checkpoint

2025-06-10 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] [RFC PATCH v2 08/32] inject.f2fs: fix injection on zoned device

2025-06-10 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] [RFC PATCH v2 28/32] tests: add fsck testcase of fixing lost dots

2025-06-10 Thread Sheng Yong
From: Sheng Yong Signed-off-by: Sheng Yong --- tests/f_dentry_lost_dots/README| 7 ++ tests/f_dentry_lost_dots/expect.in | 16 + tests/f_dentry_lost_dots/script| 37 ++ 3 files changed, 60 insertions(+) create mode 100644 tests/f_dentry_lost

[f2fs-dev] [RFC PATCH v2 09/32] inject.f2fs: fix and cleanup parsing numeric options

2025-06-10 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] [RFC PATCH v2 11/32] inject.f2fs: add member `feature' in inject_sb

2025-06-10 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 53667730775f..0b5aecbf8061 100644 --

[f2fs-dev] [RFC PATCH v2 12/32] inject.f2fs: add members in inject_node

2025-06-10 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 --- fsck/inject.c |

Re: [f2fs-dev] [PATCH v3] f2fs: compress: fix UAF of f2fs_inode_info in f2fs_free_dic

2025-06-10 Thread Jaegeuk Kim via Linux-f2fs-devel
Hi Zhiguo, This patch causes CPU hang when running fsstress on compressed/non-compressed files. Please check. On 06/05, Zhiguo Niu wrote: > The decompress_io_ctx may be released asynchronously after > I/O completion. If this file is deleted immediately after read, > and the kworker of processing

[f2fs-dev] Spolupráce s dovozcem

2025-06-10 Thread Samuel Zeman via Linux-f2fs-devel
Dobrý den, zastupuji společnost specializující se na dovoz papírenského, školního a kancelářského zboží, kreativních potřeb, dekorací a sezónních (vánočních) produktů. V naší nabídce najdete až 3000 pečlivě vybraných produktů, které jsou ideální pro velkoobchodní prodej. V současnosti obsluhu

[f2fs-dev] [RFC PATCH v2 31/32] tests: add inject testcase of injecting META area

2025-06-10 Thread Sheng Yong
From: Sheng Yong Signed-off-by: Sheng Yong --- tests/i_meta/README| 5 + tests/i_meta/expect.in | 60 tests/i_meta/script| 212 + 3 files changed, 277 insertions(+) create mode 100644 tests/i_meta/README create mode 100644 tests/

[f2fs-dev] [RFC PATCH v2 19/32] tests: add fsck testcase of fixing nat entry with invalid blkaddr

2025-06-10 Thread Sheng Yong
From: Sheng Yong Signed-off-by: Sheng Yong --- tests/f_nat_bad_blkaddr/README| 4 tests/f_nat_bad_blkaddr/expect.in | 12 tests/f_nat_bad_blkaddr/script| 25 + 3 files changed, 41 insertions(+) create mode 100644 tests/f_nat_bad_blkaddr/README

[f2fs-dev] [RFC PATCH v2 24/32] tests: add fsck testcase of fixing sum footer type

2025-06-10 Thread Sheng Yong
From: Sheng Yong Signed-off-by: Sheng Yong --- tests/f_ssa_bad_type/README| 5 + tests/f_ssa_bad_type/expect.in | 3 +++ tests/f_ssa_bad_type/script| 31 +++ 3 files changed, 39 insertions(+) create mode 100644 tests/f_ssa_bad_type/README create mode

[f2fs-dev] [RFC PATCH v2 23/32] tests: add fsck testcase of fixing sum entry nid

2025-06-10 Thread Sheng Yong
From: Sheng Yong Signed-off-by: Sheng Yong --- tests/f_ssa_bad_nid/README| 5 + tests/f_ssa_bad_nid/expect.in | 3 +++ tests/f_ssa_bad_nid/script| 36 +++ 3 files changed, 44 insertions(+) create mode 100644 tests/f_ssa_bad_nid/README create mode

[f2fs-dev] [RFC PATCH v2 29/32] tests: add fsck testcase of fixing duplicated dots

2025-06-10 Thread Sheng Yong
From: Sheng Yong Signed-off-by: Sheng Yong --- tests/f_dentry_dup_dots/README| 11 +++ tests/f_dentry_dup_dots/expect.in | 26 tests/f_dentry_dup_dots/script| 49 +++ 3 files changed, 86 insertions(+) create mode 100644 tests/f_dentry_du

[f2fs-dev] [RFC PATCH v2 05/32] dump.f2fs: print more info

2025-06-10 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] [RFC PATCH v2 20/32] tests: add fsck testcase of fixing sit entry type

2025-06-10 Thread Sheng Yong
From: Sheng Yong Signed-off-by: Sheng Yong --- tests/f_sit_bad_type/README| 5 + tests/f_sit_bad_type/expect.in | 3 +++ tests/f_sit_bad_type/script| 38 ++ 3 files changed, 46 insertions(+) create mode 100644 tests/f_sit_bad_type/README create mo

[f2fs-dev] [RFC PATCH v2 17/32] tests: add fsck testcase of fixing cp crc

2025-06-10 Thread Sheng Yong
From: Sheng Yong Signed-off-by: Sheng Yong --- tests/f_cp_bad_crc/README| 5 + tests/f_cp_bad_crc/expect.in | 4 tests/f_cp_bad_crc/script| 38 3 files changed, 47 insertions(+) create mode 100644 tests/f_cp_bad_crc/README create mode 10

[f2fs-dev] [RFC PATCH v2 26/32] tests: add fsck testcase of fixing inode invalid i_addr

2025-06-10 Thread Sheng Yong
From: Sheng Yong Signed-off-by: Sheng Yong --- tests/f_inode_bad_iaddr/README| 6 tests/f_inode_bad_iaddr/expect.in | 13 tests/f_inode_bad_iaddr/script| 50 +++ 3 files changed, 69 insertions(+) create mode 100644 tests/f_inode_bad_iaddr/READ

[f2fs-dev] [RFC PATCH v2 16/32] tests: add fsck testcase of fixing errors recorded in sb

2025-06-10 Thread Sheng Yong
From: Sheng Yong Signed-off-by: Sheng Yong --- tests/f_sb_errors/README| 5 + tests/f_sb_errors/expect.in | 7 +++ tests/f_sb_errors/script| 22 ++ 3 files changed, 34 insertions(+) create mode 100644 tests/f_sb_errors/README create mode 100644 tests/f_sb

[f2fs-dev] [RFC PATCH v2 27/32] tests: add fsck testcase of fixing dentry hash code

2025-06-10 Thread Sheng Yong
From: Sheng Yong Signed-off-by: Sheng Yong --- tests/f_dentry_bad_hash/README| 8 + tests/f_dentry_bad_hash/expect.in | 8 + tests/f_dentry_bad_hash/script| 56 +++ 3 files changed, 72 insertions(+) create mode 100644 tests/f_dentry_bad_hash/README

[f2fs-dev] [RFC PATCH v2 07/32] inject.f2fs: fix injecting sit/nat in journal

2025-06-10 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 --- fsck/inj

[f2fs-dev] [RFC PATCH v2 30/32] tests: add fsck testcase of fixing loop fsync dnodes

2025-06-10 Thread Sheng Yong
From: Sheng Yong Signed-off-by: Sheng Yong --- tests/f_loop_fsync_dnodes/README| 5 tests/f_loop_fsync_dnodes/expect.in | 6 tests/f_loop_fsync_dnodes/script| 46 + 3 files changed, 57 insertions(+) create mode 100644 tests/f_loop_fsync_dnodes/RE

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

2025-06-10 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] [RFC PATCH v2 00/32] f2fs-tools: add testcases

2025-06-10 Thread Sheng Yong
Hi, folks, This patchset tries to add an auto testsuit for f2fs-tools, including fsck.f2fs, inject.f2fs for now. The patchset can splited into 3 parts: PATCH 1~9: is a preparation for testcases. It fixes some errors in fsck and inject, and do some cleanup and improvement for

[f2fs-dev] [RFC PATCH v2 21/32] tests: add fsck testcase of fixing sit entry vblocks

2025-06-10 Thread Sheng Yong
From: Sheng Yong Signed-off-by: Sheng Yong --- tests/f_sit_bad_vblocks/README| 5 tests/f_sit_bad_vblocks/expect.in | 3 +++ tests/f_sit_bad_vblocks/script| 38 +++ 3 files changed, 46 insertions(+) create mode 100644 tests/f_sit_bad_vblocks/README c

[f2fs-dev] [RFC PATCH v2 32/32] tests: add inject testcase of injecting node block

2025-06-10 Thread Sheng Yong
From: Sheng Yong Signed-off-by: Sheng Yong --- tests/i_node/README| 5 ++ tests/i_node/expect.in | 66 tests/i_node/script| 166 + 3 files changed, 237 insertions(+) create mode 100644 tests/i_node/README create mode 100644 t

[f2fs-dev] [RFC PATCH v2 22/32] tests: add fsck testcase of fixing sit entry valid_map

2025-06-10 Thread Sheng Yong
From: Sheng Yong Signed-off-by: Sheng Yong --- tests/f_sit_bad_valid_map/README| 5 tests/f_sit_bad_valid_map/expect.in | 4 +++ tests/f_sit_bad_valid_map/script| 43 + 3 files changed, 52 insertions(+) create mode 100644 tests/f_sit_bad_valid_map/REA

[f2fs-dev] [RFC PATCH v2 14/32] tests: prepare helper scripts for testcases

2025-06-10 Thread Sheng Yong
From: Sheng Yong This patch addes helper scripts for auto testcases, and testcases of fsck will be submitted in the following commits. The basic idea of these testcases are: 1. create f2fs image 2. corrupt the image by inject specific fields 3. fsck fixes the corrupted image 4. verify fsck o

[f2fs-dev] [RFC PATCH v2 15/32] tests: add fsck testcase of fixing bad super magic

2025-06-10 Thread Sheng Yong
From: Sheng Yong Signed-off-by: Sheng Yong --- tests/f_sb_bad_magic/README| 3 +++ tests/f_sb_bad_magic/expect.in | 5 + tests/f_sb_bad_magic/script| 15 +++ 3 files changed, 23 insertions(+) create mode 100644 tests/f_sb_bad_magic/README create mode 100644 tests/f_s

[f2fs-dev] [RFC PATCH v2 03/32] f2fs-tools: cleanup {nid|segno}_in_journal

2025-06-10 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] [RFC PATCH v2 18/32] tests: add fsck testcase of fixing nat entry with invalid ino

2025-06-10 Thread Sheng Yong
From: Sheng Yong Signed-off-by: Sheng Yong --- tests/f_nat_bad_ino/README| 4 tests/f_nat_bad_ino/expect.in | 12 tests/f_nat_bad_ino/script| 31 +++ 3 files changed, 47 insertions(+) create mode 100644 tests/f_nat_bad_ino/README create m

[f2fs-dev] [RFC PATCH v2 02/32] f2fs-tools: add option N to answer no for all questions

2025-06-10 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 --- fsck/dump.c | 3 +++ fsck/fsck.c | 2 +- fsck/main.c