Re: [f2fs-dev] [PATCH 0/4] f2fs: Remove uses of writepage

2025-03-25 Thread Matthew Wilcox
On Fri, Mar 14, 2025 at 09:38:15PM +, Jaegeuk Kim wrote: > On 03/14, Matthew Wilcox wrote: > > Unfortunately, I thnk I have to abandon this effort. It's only going > > to make supporting large folios harder (ie there would then need to be > > an equivalently disruptive series adding support fo

Re: [f2fs-dev] [PATCH v5 6/6] f2fs/009: detect and repair nlink corruption

2025-03-25 Thread Chao Yu via Linux-f2fs-devel
On 3/26/25 08:47, Zorro Lang wrote: > On Wed, Mar 26, 2025 at 10:20:30AM +1100, Dave Chinner wrote: >> On Tue, Mar 25, 2025 at 08:58:24PM +0800, Chao Yu wrote: >>> This is a regression test to check whether fsck can handle corrupted >>> nlinks correctly, it uses inject.f2fs to inject nlinks w/ wron

Re: [f2fs-dev] [PATCH v2] f2fs/010: test dirty status handling on database file

2025-03-25 Thread Zorro Lang via Linux-f2fs-devel
On Tue, Mar 25, 2025 at 04:34:28PM +0800, Chao Yu wrote: > This is a regression testcase to check whether we will handle database > inode dirty status correctly: > 1. create a regular file, and write data into the file > 2. start transaction on the file (via F2FS_IOC_START_ATOMIC_WRITE) > 3. write

Re: [f2fs-dev] [PATCH v5 6/6] f2fs/009: detect and repair nlink corruption

2025-03-25 Thread Zorro Lang via Linux-f2fs-devel
On Wed, Mar 26, 2025 at 10:20:30AM +1100, Dave Chinner wrote: > On Tue, Mar 25, 2025 at 08:58:24PM +0800, Chao Yu wrote: > > This is a regression test to check whether fsck can handle corrupted > > nlinks correctly, it uses inject.f2fs to inject nlinks w/ wrong value, > > and expects fsck.f2fs can

Re: [f2fs-dev] [PATCH v5 6/6] f2fs/009: detect and repair nlink corruption

2025-03-25 Thread Dave Chinner via Linux-f2fs-devel
On Tue, Mar 25, 2025 at 08:58:24PM +0800, Chao Yu wrote: > This is a regression test to check whether fsck can handle corrupted > nlinks correctly, it uses inject.f2fs to inject nlinks w/ wrong value, > and expects fsck.f2fs can detect such corruption and do the repair. > > Cc: Jaegeuk Kim > Sign

Re: [f2fs-dev] [PATCH v2 1/2] f2fs: zone: fix to calculate first_zoned_segno correctly

2025-03-25 Thread Daeho Jeong
On Tue, Mar 25, 2025 at 1:09 AM Chao Yu via Linux-f2fs-devel wrote: > > A zoned device can has both conventional zones and sequential zones, > so we should not treat first segment of zoned device as first_zoned_segno, > instead, we need to check zone type for each zone during traversing zoned > de

Re: [f2fs-dev] Inquiry regarding plans on vmscan pageout supporting fs writepages

2025-03-25 Thread Matthew Wilcox
On Tue, Mar 25, 2025 at 10:06:55AM +, Matthew Wilcox wrote: > On Mon, Mar 24, 2025 at 08:47:05AM +0800, Nanzhe Zhao wrote: > > Knowing that the F2FS community is currently heavily invested in the > > folio support effort, I wanted to also bring up some observations and > > questions regarding f

[f2fs-dev] [PATCH v5 1/6] common/config: remove redundant export variables

2025-03-25 Thread Chao Yu via Linux-f2fs-devel
F2FS_IO_PROG and TIMEOUT_PROG are exported twice, remove the redudant one. Cc: Jaegeuk Kim Reviewed-by: David Disseldorp Signed-off-by: Zorro Lang Signed-off-by: Chao Yu --- common/config | 2 -- 1 file changed, 2 deletions(-) diff --git a/common/config b/common/config index 2afbda14..aa5258

[f2fs-dev] [PATCH v5 5/6] common/rc: introduce _check_f2fs_filesystem()

2025-03-25 Thread Chao Yu via Linux-f2fs-devel
_check_generic_filesystem() will fail the test once it detects corruption, let's introduce _check_f2fs_filesystem() to just check filesystem w/ --dry-run option, and return the error number, then let caller to decide whether the corruption is as expected or not. Cc: Jaegeuk Kim Signed-off-by: Cha

[f2fs-dev] [PATCH v5 4/6] common/rc: use -f for mkfs.f2fs by default

2025-03-25 Thread Chao Yu via Linux-f2fs-devel
Otherwise, mkfs will fail due to there is an existing filesystem in the image. Cc: Jaegeuk Kim Reviewed-by: Zorro Lang Signed-off-by: Chao Yu --- common/rc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/rc b/common/rc index e5168638..ac2bac81 100644 --- a/common

[f2fs-dev] [PATCH v5 3/6] common/config: export F2FS_FSCK_PROG

2025-03-25 Thread Chao Yu via Linux-f2fs-devel
Let's export F2FS_FSCK_PROG, then we can use it in _check_f2fs_filesystem() later. Cc: Jaegeuk Kim Reviewed-by: Zorro Lang Signed-off-by: Chao Yu --- common/config | 1 + 1 file changed, 1 insertion(+) diff --git a/common/config b/common/config index 7d017a05..79bec87f 100644 --- a/common/con

[f2fs-dev] [PATCH v5 6/6] f2fs/009: detect and repair nlink corruption

2025-03-25 Thread Chao Yu via Linux-f2fs-devel
This is a regression test to check whether fsck can handle corrupted nlinks correctly, it uses inject.f2fs to inject nlinks w/ wrong value, and expects fsck.f2fs can detect such corruption and do the repair. Cc: Jaegeuk Kim Signed-off-by: Chao Yu --- v5: - clean up codes suggested by Dave. test

[f2fs-dev] [PATCH v5 2/6] common/config: export F2FS_INJECT_PROG

2025-03-25 Thread Chao Yu via Linux-f2fs-devel
export F2FS_INJECT_PROG w/ inject.f2fs, it can be used for fault injection. Cc: Jaegeuk Kim Reviewed-by: David Disseldorp Reviewed-by: Zorro Lang Signed-off-by: Chao Yu --- common/config | 1 + 1 file changed, 1 insertion(+) diff --git a/common/config b/common/config index aa525825..7d017a05

Re: [f2fs-dev] [PATCH v4 6/6] f2fs/009: detect and repair nlink corruption

2025-03-25 Thread Chao Yu via Linux-f2fs-devel
On 3/25/25 17:15, Dave Chinner wrote: > On Wed, Mar 12, 2025 at 03:23:09PM +0800, Chao Yu wrote: >> This is a regression test to check whether fsck can handle corrupted >> nlinks correctly, it uses inject.f2fs to inject nlinks w/ wrong value, >> and expects fsck.f2fs can detect such corruption and

Re: [f2fs-dev] [PATCH v4 6/6] f2fs/009: detect and repair nlink corruption

2025-03-25 Thread Dave Chinner via Linux-f2fs-devel
On Wed, Mar 12, 2025 at 03:23:09PM +0800, Chao Yu wrote: > This is a regression test to check whether fsck can handle corrupted > nlinks correctly, it uses inject.f2fs to inject nlinks w/ wrong value, > and expects fsck.f2fs can detect such corruption and do the repair. > > Cc: Jaegeuk Kim > Sign

Re: [f2fs-dev] [PATCH v2] f2fs: add a fast path in finish_preallocate_blocks()

2025-03-25 Thread Zhiguo Niu
Chao Yu via Linux-f2fs-devel 于2025年3月25日周二 16:15写道: > > This patch uses i_sem to protect access/update on f2fs_inode_info.flag > in finish_preallocate_blocks(), it avoids grabbing inode_lock() in > each open(). > > Signed-off-by: Chao Yu Reviewed-by: Zhiguo Niu thanks! > --- > v2: > - get rid o

[f2fs-dev] [PATCH v2 2/2] f2fs: zone: fix to avoid inconsistence in between SIT and SSA

2025-03-25 Thread Chao Yu via Linux-f2fs-devel
w/ below testcase, it will cause inconsistence in between SIT and SSA. create_null_blk 512 2 1024 1024 mkfs.f2fs -m /dev/nullb0 mount /dev/nullb0 /mnt/f2fs/ touch /mnt/f2fs/file f2fs_io pinfile set /mnt/f2fs/file fallocate -l 4GiB /mnt/f2fs/file F2FS-fs (nullb0): Inconsistent segment (0) type [1,

[f2fs-dev] [PATCH v2] f2fs/010: test dirty status handling on database file

2025-03-25 Thread Chao Yu via Linux-f2fs-devel
This is a regression testcase to check whether we will handle database inode dirty status correctly: 1. create a regular file, and write data into the file 2. start transaction on the file (via F2FS_IOC_START_ATOMIC_WRITE) 3. write transaction data to the file 4. rename the file 5. commit and end t

[f2fs-dev] [PATCH v2] f2fs: add a fast path in finish_preallocate_blocks()

2025-03-25 Thread Chao Yu via Linux-f2fs-devel
This patch uses i_sem to protect access/update on f2fs_inode_info.flag in finish_preallocate_blocks(), it avoids grabbing inode_lock() in each open(). Signed-off-by: Chao Yu --- v2: - get rid of read lock during querying FI_OPENED_FILE once we held inode lock. fs/f2fs/file.c | 37 +++

Re: [f2fs-dev] [PATCH] f2fs: add a fast path in finish_preallocate_blocks()

2025-03-25 Thread Chao Yu via Linux-f2fs-devel
On 3/25/25 14:31, Zhiguo Niu wrote: > Chao Yu via Linux-f2fs-devel > 于2025年3月24日周一 19:36写道: >> >> This patch uses i_sem to protect access/update on f2fs_inode_info.flag >> in finish_preallocate_blocks(), it avoids grabbing inode_lock() in >> each open(). >> >> Signed-off-by: Chao Yu >> --- >> fs

[f2fs-dev] [PATCH v2 1/2] f2fs: zone: fix to calculate first_zoned_segno correctly

2025-03-25 Thread Chao Yu via Linux-f2fs-devel
A zoned device can has both conventional zones and sequential zones, so we should not treat first segment of zoned device as first_zoned_segno, instead, we need to check zone type for each zone during traversing zoned device to find first_zoned_segno. Otherwise, for below case, first_zoned_segno w

Re: [f2fs-dev] [PATCH] f2fs/010: test dirty status handling on database file

2025-03-25 Thread Chao Yu via Linux-f2fs-devel
On 3/25/25 09:18, Zorro Lang wrote: > On Mon, Mar 24, 2025 at 08:38:36PM +0800, Chao Yu wrote: >> This is a regression testcase to check whether we will handle database >> inode dirty status correctly: >> 1. create a regular file, and write data into the file >> 2. start transaction on the file (vi