Re: [f2fs-dev] [PATCH] f2fs: fix to check result of new_curseg in f2fs_allocate_segment_for_resize

2024-03-03 Thread Zhiguo Niu
On Mon, Mar 4, 2024 at 3:17 PM Chao Yu wrote: > > On 2024/3/4 11:33, Zhiguo Niu wrote: > > On Mon, Mar 4, 2024 at 11:19 AM Chao Yu wrote: > >> > >> On 2024/3/1 19:36, Zhiguo Niu wrote: > >>> new_curseg may return error if get_new_segment fail, so its result > >>> should be check in its caller

Re: [f2fs-dev] [PATCH] f2fs: fix to check result of new_curseg in f2fs_allocate_segment_for_resize

2024-03-03 Thread Chao Yu
On 2024/3/4 11:33, Zhiguo Niu wrote: On Mon, Mar 4, 2024 at 11:19 AM Chao Yu wrote: On 2024/3/1 19:36, Zhiguo Niu wrote: new_curseg may return error if get_new_segment fail, so its result should be check in its caller f2fs_allocate_segment_for_resize, alos pass this results to

Re: [f2fs-dev] [PATCH] f2fs: fix to check result of new_curseg in f2fs_allocate_segment_for_resize

2024-03-03 Thread Zhiguo Niu
On Mon, Mar 4, 2024 at 11:19 AM Chao Yu wrote: > > On 2024/3/1 19:36, Zhiguo Niu wrote: > > new_curseg may return error if get_new_segment fail, so its result > > should be check in its caller f2fs_allocate_segment_for_resize, > > alos pass this results to free_segment_range. > > Zhiguo, > > What

[f2fs-dev] [PATCH v2] f2fs: introduce SEGS_TO_BLKS/BLKS_TO_SEGS for cleanup

2024-03-03 Thread Chao Yu
Just cleanup, no functional change. Signed-off-by: Chao Yu --- v2: - don't cast type of segment number from unsigned int to long long, because segs << log_blocks_per_seg won't overflow due to f2fs doesn't support 64-bits addressing. fs/f2fs/debug.c | 7 +++ fs/f2fs/f2fs.h| 14

Re: [f2fs-dev] [PATCH] f2fs: fix to check result of new_curseg in f2fs_allocate_segment_for_resize

2024-03-03 Thread Chao Yu
On 2024/3/1 19:36, Zhiguo Niu wrote: new_curseg may return error if get_new_segment fail, so its result should be check in its caller f2fs_allocate_segment_for_resize, alos pass this results to free_segment_range. Zhiguo, What about handling all error paths of new_curseg() and change_curseg()

Re: [f2fs-dev] [PATCH 2/2] f2fs: fix to check return value of f2fs_gc_range

2024-03-03 Thread Chao Yu
On 2024/3/1 16:25, Zhiguo Niu wrote: f2fs_gc_range may return error, so its caller f2fs_allocate_pinning_section should determine whether to do retry based on ist return value. Also just do f2fs_gc_range when f2fs_allocate_new_section return -EAGAIN, and check cp error case in f2fs_gc_range.

Re: [f2fs-dev] [PATCH 1/2] f2fs: fix to check return value __allocate_new_segment

2024-03-03 Thread Chao Yu
On 2024/3/1 16:25, Zhiguo Niu wrote: __allocate_new_segment may return error when get_new_segment fails, so its caller should check its return value. Signed-off-by: Zhiguo Niu Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list