Re: [f2fs-dev] [PATCH 3/4] f2fs: fix to handle segment allocation failure correctly

2024-02-25 Thread Chao Yu
Loop to Zhiguo, On 2024/2/22 20:18, Chao Yu wrote: If CONFIG_F2FS_CHECK_FS is off, and for very rare corner case that we run out of free segment, we should not panic kernel, instead, let's handle such error correctly in its caller. Signed-off-by: Chao Yu --- fs/f2fs/data.c| 7 +--

[f2fs-dev] [PATCH 1/2] f2fs: ro: compress: fix to avoid caching unaligned extent

2024-02-25 Thread Chao Yu
Mapping info from dump.f2fs: i_addr[0x2d] cluster flag [0xfffe : 4294967294] i_addr[0x2e][0x 10428 : 66600] i_addr[0x2f][0x 10429 : 66601] i_addr[0x30][0x 1042a : 66602] f2fs_io fiemap 37 1

[f2fs-dev] [PATCH 2/2] f2fs: ro: don't start discard thread for readonly image

2024-02-25 Thread Chao Yu
[ 9299.893835] F2FS-fs (vdd): Allow to mount readonly mode only mount: /mnt/f2fs: WARNING: source write-protected, mounted read-only. root@qemu:/ ps -ef|grep f2fs root 94 2 0 03:46 ?00:00:00 [kworker/u17:0-f2fs_post_read_wq] root6282 2 0 06:21 ?

Re: [f2fs-dev] [PATCH v2 0/4] f2fs: fix panic issue in small capacity device

2024-02-25 Thread Chao Yu
On 2024/2/26 11:25, Zhiguo Niu wrote: Dear Chao, On Fri, Feb 23, 2024 at 10:38 AM Chao Yu wrote: On 2024/2/23 10:01, Zhiguo Niu wrote: On Thu, Feb 22, 2024 at 8:30 PM Chao Yu mailto:c...@kernel.org>> wrote: On 2024/2/7 10:01, Zhiguo Niu wrote: > A panic issue happened in a

Re: [f2fs-dev] [PATCH v2 0/4] f2fs: fix panic issue in small capacity device

2024-02-25 Thread Zhiguo Niu
Dear Chao, On Fri, Feb 23, 2024 at 10:38 AM Chao Yu wrote: > > On 2024/2/23 10:01, Zhiguo Niu wrote: > > > > > > On Thu, Feb 22, 2024 at 8:30 PM Chao Yu > > wrote: > > > > On 2024/2/7 10:01, Zhiguo Niu wrote: > > > A panic issue happened in a reboot test in

[f2fs-dev] [PATCH] f2fs: fix to check return value in f2fs_insert_range()

2024-02-25 Thread Chao Yu
In f2fs_insert_range(), it missed to check return value of filemap_write_and_wait_range(), fix it. Meanwhile, just return error number once __exchange_data_block() fails. Signed-off-by: Chao Yu --- fs/f2fs/file.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git

Re: [f2fs-dev] [PATCH 5/5] f2fs: allow to mount if cap is 100

2024-02-25 Thread Chao Yu
On 2024/2/24 4:55, Jaegeuk Kim wrote: Don't block mounting the partition, if cap is 100%. Signed-off-by: Jaegeuk Kim Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net

Re: [f2fs-dev] [PATCH 4/5] f2fs: prevent an f2fs_gc loop during disable_checkpoint

2024-02-25 Thread Chao Yu
On 2024/2/24 4:55, Jaegeuk Kim wrote: Don't get stuck in the f2fs_gc loop while disabling checkpoint. Instead, we have a time-based management. Signed-off-by: Jaegeuk Kim Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list

Re: [f2fs-dev] [PATCH 3/5] f2fs: print zone status in string and some log

2024-02-25 Thread Chao Yu
On 2024/2/24 4:55, Jaegeuk Kim wrote: No functional change, but add some more logs. Signed-off-by: Jaegeuk Kim Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net

Re: [f2fs-dev] [PATCH 2/5] f2fs: fix write pointers all the time

2024-02-25 Thread Chao Yu
On 2024/2/24 4:55, Jaegeuk Kim wrote: Even if the roll forward recovery stopped due to any error, we have to fix the write pointers in order to mount the disk from the previous checkpoint. Jaegeuk, IIUC, we may lost warm node chain once we allocate new section for all logs, should we give

Re: [f2fs-dev] [PATCH 1/5] f2fs: check number of blocks in a current section

2024-02-25 Thread Chao Yu
On 2024/2/24 4:55, Jaegeuk Kim wrote: In cfd66bb715fd ("f2fs: fix deadloop in foreground GC"), we needed to check the number of blocks in a section instead of the segment. In addtion, let's check the entire node sections when checking the avaiable node block space. It does not match one to one

Re: [f2fs-dev] [PATCH] f2fs: compress: reserve blocks on released compress inode while writing

2024-02-25 Thread Chao Yu
On 2024/1/10 17:10, Yangtao Li wrote: Reserve blocks on released compress inode while writing, so compressed files with released space are allowed to be rewritten. Signed-off-by: Yangtao Li --- fs/f2fs/file.c | 86 ++ 1 file changed, 51

[f2fs-dev] [PATCH 1/4] f2fs: fix blkofs_end correctly in f2fs_migrate_blocks()

2024-02-25 Thread Chao Yu
In f2fs_migrate_blocks(), when traversing blocks in last section, blkofs_end should be (start_blk + blkcnt - 1) % blk_per_sec, fix it. Signed-off-by: Chao Yu --- fs/f2fs/data.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index

[f2fs-dev] [PATCH 3/4] f2fs: clean up new_curseg()

2024-02-25 Thread Chao Yu
Move f2fs_valid_pinned_area() check logic from new_curseg() to get_new_segment(), it can avoid calling __set_free() if it fails to find free segment in conventional zone for pinned file. Signed-off-by: Chao Yu --- fs/f2fs/segment.c | 23 ++- 1 file changed, 14 insertions(+),

[f2fs-dev] [PATCH 2/4] f2fs: relocate f2fs_precache_extents() in f2fs_swap_activate()

2024-02-25 Thread Chao Yu
This patch exchangs position of f2fs_precache_extents() and filemap_fdatawrite(), so that f2fs_precache_extents() can load extent info after physical addresses of all data are fixed. Signed-off-by: Chao Yu --- fs/f2fs/data.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[f2fs-dev] [PATCH 4/4] f2fs: fix to reset fields for unloaded curseg

2024-02-25 Thread Chao Yu
In f2fs_allocate_data_block(), before skip allocating new segment for DATA_PINNED log header, it needs to tag log header as unloaded one to avoid skipping logic in locate_dirty_segment() and __f2fs_save_inmem_curseg(). Signed-off-by: Chao Yu --- fs/f2fs/segment.c | 19 +++ 1

[f2fs-dev] 答复: [PATCH v3] f2fs: reduce expensive checkpoint trigger frequency

2024-02-25 Thread Zhiguo Niu
Hi Jaegeuk Sorry for disturbing you, Do you have any comments about this patch from Chao, I’ve met this issue several times on our platform when do monkey test. Thanks! -邮件原件- 发件人: Chao Yu 发送时间: 2024年2月19日 15:19 收件人: jaeg...@kernel.org 抄送: linux-f2fs-devel@lists.sourceforge.net;