[f2fs-dev] [RFC PATCH 10/24] tests: add fsck testcase of fixing errors recorded in sb

2024-10-29 Thread Sheng Yong via Linux-f2fs-devel
Signed-off-by: Sheng Yong --- tests/f_sb_errors/README| 5 tests/f_sb_errors/expect.in | 59 + tests/f_sb_errors/script| 23 +++ 3 files changed, 87 insertions(+) create mode 100644 tests/f_sb_errors/README create mode 100644 tests/f

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

2024-10-29 Thread Sheng Yong via Linux-f2fs-devel
Signed-off-by: Sheng Yong --- tests/f_nat_bad_blkaddr/README| 4 tests/f_nat_bad_blkaddr/expect.in | 39 +++ tests/f_nat_bad_blkaddr/script| 35 +++ 3 files changed, 78 insertions(+) create mode 100644 tests/f_nat_bad_blkaddr/READ

[f2fs-dev] [RFC PATCH 05/24] inject.f2fs: add member `feature' in inject_sb

2024-10-29 Thread Sheng Yong via Linux-f2fs-devel
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 c3e68eb35246..c997334ec57d 100644 --- a/fsck/inject.c +

[f2fs-dev] [RFC PATCH 19/24] tests: add fsck testcase of fixing sum entry ofs_in_node

2024-10-29 Thread Sheng Yong via Linux-f2fs-devel
Signed-off-by: Sheng Yong --- tests/f_ssa_bad_ofs_in_node/README| 5 +++ tests/f_ssa_bad_ofs_in_node/expect.in | 34 + tests/f_ssa_bad_ofs_in_node/script| 44 +++ 3 files changed, 83 insertions(+) create mode 100644 tests/f_ssa_bad_ofs_in_node

[f2fs-dev] [RFC PATCH 14/24] tests: add fsck testcase of fixing sit entry type

2024-10-29 Thread Sheng Yong via Linux-f2fs-devel
Signed-off-by: Sheng Yong --- tests/f_sit_bad_type/README| 5 tests/f_sit_bad_type/expect.in | 34 + tests/f_sit_bad_type/script| 45 ++ 3 files changed, 84 insertions(+) create mode 100644 tests/f_sit_bad_type/README create

[f2fs-dev] [RFC PATCH 15/24] tests: add fsck testcase of fixing sit entry vblocks

2024-10-29 Thread Sheng Yong via Linux-f2fs-devel
Signed-off-by: Sheng Yong --- tests/f_sit_bad_vblocks/README| 5 tests/f_sit_bad_vblocks/expect.in | 34 +++ tests/f_sit_bad_vblocks/script| 45 +++ 3 files changed, 84 insertions(+) create mode 100644 tests/f_sit_bad_vblocks/README

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

2024-10-29 Thread Sheng Yong via Linux-f2fs-devel
Signed-off-by: Sheng Yong --- tests/f_ssa_bad_type/README| 5 + tests/f_ssa_bad_type/expect.in | 34 + tests/f_ssa_bad_type/script| 39 ++ 3 files changed, 78 insertions(+) create mode 100644 tests/f_ssa_bad_type/README cr

[f2fs-dev] [RFC PATCH 12/24] tests: add fsck testcase of fixing nat entry with invalid ino

2024-10-29 Thread Sheng Yong via Linux-f2fs-devel
Signed-off-by: Sheng Yong --- tests/f_nat_bad_ino/README| 4 tests/f_nat_bad_ino/expect.in | 39 +++ tests/f_nat_bad_ino/script| 39 +++ 3 files changed, 82 insertions(+) create mode 100644 tests/f_nat_bad_ino/README

[f2fs-dev] [RFC PATCH 20/24] tests: add fsck testcase of fixing invalid i_addr

2024-10-29 Thread Sheng Yong via Linux-f2fs-devel
Signed-off-by: Sheng Yong --- tests/f_inode_bad_iaddr/README| 6 tests/f_inode_bad_iaddr/expect.in | 38 tests/f_inode_bad_iaddr/script| 58 +++ 3 files changed, 102 insertions(+) create mode 100644 tests/f_inode_bad_iaddr/README cr

[f2fs-dev] [RFC PATCH 17/24] tests: add fsck testcase of fixing sum entry nid

2024-10-29 Thread Sheng Yong via Linux-f2fs-devel
Signed-off-by: Sheng Yong --- tests/f_ssa_bad_nid/README| 5 tests/f_ssa_bad_nid/expect.in | 34 +++ tests/f_ssa_bad_nid/script| 44 +++ 3 files changed, 83 insertions(+) create mode 100644 tests/f_ssa_bad_nid/README create m

[f2fs-dev] [RFC PATCH 16/24] tests: add fsck testcase of fixing sit entry valid_map

2024-10-29 Thread Sheng Yong via Linux-f2fs-devel
Signed-off-by: Sheng Yong --- tests/f_sit_bad_valid_map/README| 5 +++ tests/f_sit_bad_valid_map/expect.in | 35 tests/f_sit_bad_valid_map/script| 50 + 3 files changed, 90 insertions(+) create mode 100644 tests/f_sit_bad_valid_map/README

[f2fs-dev] [PATCH v2] mkfs.f2fs: adjust zone alignment when using convention partition with zoned one

2024-10-29 Thread Yohan Joung
When formatting conventional partition with zoned one, we are already aligning the starting block address of the next device to the zone size. Therefore, we do not align the segment0 address to the zone alignment. This reduces the wasted zone_align_start_offset. Test result segment0 blkaddr 389583

Re: [f2fs-dev] [PATCH v4 1/2] f2fs/006: add testcase to check out-of-space case

2024-10-29 Thread Zorro Lang
On Tue, Oct 29, 2024 at 06:26:43PM +0800, Chao Yu wrote: > This is a regression test to check whether f2fs handles dirty > data correctly when checkpoint is disabled, if lfs mode is on, > it will trigger OPU for all overwritten data, this will cost > free segments, so f2fs must account overwritten

Re: [f2fs-dev] [PATCH v3 1/2] f2fs/006: add testcase to check out-of-space case

2024-10-29 Thread Chao Yu via Linux-f2fs-devel
On 2024/10/29 14:09, Zorro Lang wrote: On Mon, Oct 28, 2024 at 10:17:59PM +0800, Chao Yu wrote: This is a regression test to check whether f2fs handles dirty data correctly when checkpoint is disabled, if lfs mode is on, it will trigger OPU for all overwritten data, this will cost free segments,

[f2fs-dev] [PATCH v4 1/2] f2fs/006: add testcase to check out-of-space case

2024-10-29 Thread Chao Yu via Linux-f2fs-devel
This is a regression test to check whether f2fs handles dirty data correctly when checkpoint is disabled, if lfs mode is on, it will trigger OPU for all overwritten data, this will cost free segments, so f2fs must account overwritten data as OPU data when calculating free space, otherwise, it may r

[f2fs-dev] [PATCH] f2fs: clean up the unused variable additional_reserved_segments

2024-10-29 Thread LongPing Wei via Linux-f2fs-devel
additional_reserved_segments was introduced by commit 300a842937fb ("f2fs: fix to reserve space for IO align feature"), and its initialization was deleted by commit 87161a2b0aed ("f2fs: deprecate io_bits"). Signed-off-by: LongPing Wei --- fs/f2fs/f2fs.h| 1 - fs/f2fs/segment.h | 3 +-- fs/f2

[f2fs-dev] [PATCH v4 2/2] f2fs/007: add testcase to check consistency of compressed inode metadata

2024-10-29 Thread Chao Yu via Linux-f2fs-devel
metadata of compressed inode should always be consistent after file compression, reservation, releasement and decompression, let's add a testcase to check it. Cc: Jaegeuk Kim Cc: Qi Han Reviewed-by: Zorro Lang Signed-off-by: Chao Yu --- v4: - fix typo - add rvb tag from Zorro tests/f2fs/007

[f2fs-dev] [RFC PATCH 04/24] inject.f2fs: add members in inject_cp

2024-10-29 Thread Sheng Yong via Linux-f2fs-devel
The following members are add 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 segnemt, any dnode ch

[f2fs-dev] [RFC PATCH 06/24] inject.f2fs: add members in inject_node

2024-10-29 Thread Sheng Yong via Linux-f2fs-devel
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 | 28

[f2fs-dev] [RFC PATCH 01/24] f2fs-tools: add option N to answer no for all questions

2024-10-29 Thread Sheng Yong via Linux-f2fs-devel
In some scenarino, 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 | 14

[f2fs-dev] [RFC PATCH 08/24] tests: prepare helper scripts for testcases

2024-10-29 Thread Sheng Yong via Linux-f2fs-devel
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 output with expected

[f2fs-dev] [RFC PATCH 11/24] tests: add fsck testcase of fixing cp crc

2024-10-29 Thread Sheng Yong via Linux-f2fs-devel
Signed-off-by: Sheng Yong --- tests/f_cp_bad_crc/README| 5 tests/f_cp_bad_crc/expect.in | 22 + tests/f_cp_bad_crc/script| 46 3 files changed, 73 insertions(+) create mode 100644 tests/f_cp_bad_crc/README create mode 100644 te

[f2fs-dev] [RFC PATCH 21/24] tests: add fsck testcase of fixing dentry hash code

2024-10-29 Thread Sheng Yong via Linux-f2fs-devel
Signed-off-by: Sheng Yong --- tests/f_dentry_bad_hash/README| 8 tests/f_dentry_bad_hash/expect.in | 62 +++ tests/f_dentry_bad_hash/script| 71 +++ 3 files changed, 141 insertions(+) create mode 100644 tests/f_dentry_bad_hash/REA

[f2fs-dev] [RFC PATCH 00/24] f2fs-tools: add testcases

2024-10-29 Thread Sheng Yong via Linux-f2fs-devel
Hi, all This patchset tries to add an auto testsuit for f2fs-tools (fsck only for now). The basic idea of these testcases are: 1. create f2fs image 2. corrupt the image by inject specific fields 3. fsck fixes the image 4. verify fsck output with expected message Some helper scripts are provi

[f2fs-dev] [RFC PATCH 22/24] tests: add fsck testcase of fixing lost dots

2024-10-29 Thread Sheng Yong via Linux-f2fs-devel
Signed-off-by: Sheng Yong --- tests/f_dentry_lost_dots/README| 7 +++ tests/f_dentry_lost_dots/expect.in | 74 ++ tests/f_dentry_lost_dots/script| 46 +++ 3 files changed, 127 insertions(+) create mode 100644 tests/f_dentry_lost_dots/README c

[f2fs-dev] [RFC PATCH 02/24] dump.f2fs: print checkpoint crc

2024-10-29 Thread Sheng Yong via Linux-f2fs-devel
Signed-off-by: Sheng Yong --- fsck/mount.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/fsck/mount.c b/fsck/mount.c index a189ba73e4bf..a09a974fc810 100644 --- a/fsck/mount.c +++ b/fsck/mount.c @@ -560,6 +560,7 @@ printout: void print_ckpt_info(struct f2fs_sb_info *sbi) { s

[f2fs-dev] [RFC PATCH 09/24] tests: add fsck testcase of fixing bad super magic

2024-10-29 Thread Sheng Yong via Linux-f2fs-devel
Signed-off-by: Sheng Yong --- tests/f_sb_bad_magic/README| 3 +++ tests/f_sb_bad_magic/expect.in | 40 ++ tests/f_sb_bad_magic/script| 16 ++ 3 files changed, 59 insertions(+) create mode 100644 tests/f_sb_bad_magic/README create mode 100644

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

2024-10-29 Thread Sheng Yong via Linux-f2fs-devel
Signed-off-by: Sheng Yong --- tests/f_loop_fsync_dnodes/README | 39 + tests/f_loop_fsync_dnodes/expect.in | 40 ++ tests/f_loop_fsync_dnodes/imgs.tar.gz | Bin 0 -> 173228 bytes tests/f_loop_fsync_dnodes/script | 16 +++ 4 fi

[f2fs-dev] [RFC PATCH 23/24] tests: add fsck testcase of fixing duplicated dots

2024-10-29 Thread Sheng Yong via Linux-f2fs-devel
Signed-off-by: Sheng Yong --- tests/f_dentry_dup_dots/README| 11 +++ tests/f_dentry_dup_dots/expect.in | 150 ++ tests/f_dentry_dup_dots/script| 58 3 files changed, 219 insertions(+) create mode 100644 tests/f_dentry_dup_dots/README create mo

[f2fs-dev] [RFC PATCH 07/24] inject.f2fs: add member `filename' in inject_dentry

2024-10-29 Thread Sheng Yong via Linux-f2fs-devel
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 these two dentries.

[f2fs-dev] [RFC PATCH 03/24] fsck.f2fs: fix invalidate checkpoint

2024-10-29 Thread Sheng Yong via Linux-f2fs-devel
If one cp is invalidate, set CP_FSCK_FLAG to allow 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 index 187e73cf9aec..651a1f734281 1006

Re: [f2fs-dev] [PATCH] f2fs: clean up the unused variable additional_reserved_segments

2024-10-29 Thread Chao Yu via Linux-f2fs-devel
On 2024/10/29 18:49, LongPing Wei wrote: additional_reserved_segments was introduced by commit 300a842937fb ("f2fs: fix to reserve space for IO align feature"), and its initialization was deleted by commit 87161a2b0aed ("f2fs: deprecate io_bits"). Signed-off-by: LongPing Wei Reviewed-by: Chao

Re: [f2fs-dev] [PATCH v2] mkfs.f2fs: adjust zone alignment when using convention partition with zoned one

2024-10-29 Thread Daeho Jeong
Reviewed-by: Daeho Jeong Thanks, On Tue, Oct 29, 2024 at 6:45 AM Yohan Joung wrote: > > When formatting conventional partition with zoned one, we are already > aligning the starting block address of the next device to the zone size. > Therefore, we do not align the segment0 address to the zone

Re: [f2fs-dev] [PATCH v3 1/2] f2fs/006: add testcase to check out-of-space case

2024-10-29 Thread Chao Yu via Linux-f2fs-devel
On 2024/10/29 16:57, Zorro Lang wrote: On Tue, Oct 29, 2024 at 03:46:21PM +0800, Chao Yu wrote: On 2024/10/29 14:09, Zorro Lang wrote: On Mon, Oct 28, 2024 at 10:17:59PM +0800, Chao Yu wrote: This is a regression test to check whether f2fs handles dirty data correctly when checkpoint is disabl

[f2fs-dev] [PATCH V2] f2fs-io: unify default block size

2024-10-29 Thread Zhiguo Niu
F2FS_BLKSIZE and 4096 are both used in f2fs_io for IO/buffer size, but F2FS_BLKSIZE may confuse user becasue it may be 4KB, 16KB, so use macro F2FS_DEFAULT_BLKSIZE to unify F2FS_BLKSIZE and 4096 in f2fs_io, also adjust "-c" parameters in mkfs man, to be consistent with commit c35fa8cd75ac ("mkfs.f2

Re: [f2fs-dev] [PATCH v3 2/2] f2fs/007: add testcase to check consistency of compressed inode metadata

2024-10-29 Thread Chao Yu via Linux-f2fs-devel
On 2024/10/29 14:21, Zorro Lang wrote: On Mon, Oct 28, 2024 at 10:18:00PM +0800, Chao Yu wrote: metadata of compressed inode should always be consistent after file compression, reservation, releasement and decompression, let's add a testcase to check it. Cc: Jaegeuk Kim Cc: Qi Han Signed-off-

Re: [f2fs-dev] Plans for F2FS Supporting Large Folios

2024-10-29 Thread Ryan Roberts
Hi Jaegeuk, Just a polite bump on the below... On 09/10/2024 12:23, Ryan Roberts wrote: > On 07/10/2024 17:38, Jaegeuk Kim wrote: >> Hi Ryan, >> >> On 10/02, Ryan Roberts wrote: >>> Hi Jaegeuk Kim, Chao Yu, >>> >>> I heard (via Matthew Wilcox) that you may be in the process of forming >>> plans

Re: [f2fs-dev] [PATCH v3 1/2] f2fs/006: add testcase to check out-of-space case

2024-10-29 Thread Zorro Lang
On Tue, Oct 29, 2024 at 03:46:21PM +0800, Chao Yu wrote: > On 2024/10/29 14:09, Zorro Lang wrote: > > On Mon, Oct 28, 2024 at 10:17:59PM +0800, Chao Yu wrote: > > > This is a regression test to check whether f2fs handles dirty > > > data correctly when checkpoint is disabled, if lfs mode is on, > >