[f2fs-dev] [PATCH v3] f2fs-tools: fix to check loop device for non-root users

2024-02-29 Thread Huang Jianan via Linux-f2fs-devel
Currently mkfs/fsck gets the following error when executed by non-root users: Info: open /dev/loop0 failed errno:13 Error: Not available on mounted device! Let's fix it by reading the backing file from sysfs. Fixes: 14197d546b93 ("f2fs-tools: fix to check loop device") Signed-off-by:

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

2024-02-29 Thread Chao Yu
On 2024/3/1 9:57, Jaegeuk Kim wrote: On 03/01, Chao Yu wrote: On 2024/3/1 0:35, Jaegeuk Kim wrote: On 02/29, Chao Yu wrote: On 2024/2/28 1:47, Jaegeuk Kim wrote: On 02/21, Chao Yu wrote: Just cleanup, no functional change. Signed-off-by: Chao Yu --- fs/f2fs/debug.c | 7 +++

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

2024-02-29 Thread Jaegeuk Kim
On 03/01, Chao Yu wrote: > On 2024/3/1 1:41, Daeho Jeong wrote: > > On Thu, Feb 29, 2024 at 2:11 AM Chao Yu wrote: > > > > > > Jaegeuk, Daeho, > > > > > > Any comments on this serials? > > > > > > Thanks, > > > > No functional difference here, since start_blk is always aligned with > > the

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

2024-02-29 Thread Jaegeuk Kim
On 03/01, Chao Yu wrote: > On 2024/3/1 0:35, Jaegeuk Kim wrote: > > On 02/29, Chao Yu wrote: > > > On 2024/2/28 1:47, Jaegeuk Kim wrote: > > > > On 02/21, Chao Yu wrote: > > > > > Just cleanup, no functional change. > > > > > > > > > > Signed-off-by: Chao Yu > > > > > --- > > > > >

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

2024-02-29 Thread Chao Yu
On 2024/3/1 1:41, Daeho Jeong wrote: On Thu, Feb 29, 2024 at 2:11 AM Chao Yu wrote: Jaegeuk, Daeho, Any comments on this serials? Thanks, No functional difference here, since start_blk is always aligned with the section address. You're right. However, this is more clear in itself.

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

2024-02-29 Thread Chao Yu
On 2024/3/1 0:35, Jaegeuk Kim wrote: On 02/29, Chao Yu wrote: On 2024/2/28 1:47, Jaegeuk Kim wrote: On 02/21, Chao Yu wrote: Just cleanup, no functional change. Signed-off-by: Chao Yu --- fs/f2fs/debug.c | 7 +++ fs/f2fs/f2fs.h| 14 -- fs/f2fs/gc.c | 10

Re: [f2fs-dev] [PATCH] f2fs: fix to do sanity check in update_sit_entry

2024-02-29 Thread Chao Yu
On 2024/2/28 19:59, Zhiguo Niu wrote: If GET_SEGNO return NULL_SEGNO for some unecpected case, update_sit_entry will access invalid memory address, cause system crash. It is better to do sanity check about GET_SEGNO just like update_segment_mtime & locate_dirty_segment. Also remove some

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

2024-02-29 Thread Daeho Jeong
Reviewed-by: Daeho Jeong Thanks, On Sun, Feb 25, 2024 at 5:33 PM Chao Yu wrote: > > 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 >

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

2024-02-29 Thread Daeho Jeong
Reviewed-by: Daeho Jeong Thanks, On Sun, Feb 25, 2024 at 5:33 PM Chao Yu wrote: > > 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:

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

2024-02-29 Thread Daeho Jeong
On Thu, Feb 29, 2024 at 2:11 AM Chao Yu wrote: > > Jaegeuk, Daeho, > > Any comments on this serials? > > Thanks, No functional difference here, since start_blk is always aligned with the section address. However, this is more clear in itself. Reviewed-by: Daeho Jeong Thanks, > > On 2024/2/26

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

2024-02-29 Thread Daeho Jeong
Reviewed-by: Daeho Jeong Thanks, On Sun, Feb 25, 2024 at 5:33 PM Chao Yu wrote: > > 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

Re: [f2fs-dev] [PATCH][next] f2fs: Fix two spelling mistakes in f2fs_zone_status array

2024-02-29 Thread Jaegeuk Kim
On 02/29, Colin King (gmail) wrote: > On 29/02/2024 17:12, Jaegeuk Kim wrote: > > Hi Colin, > > > > Thank you for the fix. If you don't mind, can I integrate this fix > > into the original patch? > > Sure. No problem. Thank you so much! > > Colin > > > > Thanks, > > > > On 02/29, Colin Ian

Re: [f2fs-dev] [PATCH][next] f2fs: Fix two spelling mistakes in f2fs_zone_status array

2024-02-29 Thread Colin King (gmail)
On 29/02/2024 17:12, Jaegeuk Kim wrote: Hi Colin, Thank you for the fix. If you don't mind, can I integrate this fix into the original patch? Sure. No problem. Colin Thanks, On 02/29, Colin Ian King wrote: The array f2fs_zone_status contains two spelling mistakes in literal strings. Fix

Re: [f2fs-dev] [PATCH][next] f2fs: Fix two spelling mistakes in f2fs_zone_status array

2024-02-29 Thread Jaegeuk Kim
Hi Colin, Thank you for the fix. If you don't mind, can I integrate this fix into the original patch? Thanks, On 02/29, Colin Ian King wrote: > The array f2fs_zone_status contains two spelling mistakes in > literal strings. Fix them. > > Signed-off-by: Colin Ian King > --- >

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

2024-02-29 Thread Jaegeuk Kim
On 02/29, Chao Yu wrote: > On 2024/2/28 1:47, Jaegeuk Kim wrote: > > On 02/21, Chao Yu wrote: > > > Just cleanup, no functional change. > > > > > > Signed-off-by: Chao Yu > > > --- > > > fs/f2fs/debug.c | 7 +++ > > > fs/f2fs/f2fs.h| 14 -- > > > fs/f2fs/gc.c | 10

[f2fs-dev] [PATCH] f2fs: support .shutdown in f2fs_sops

2024-02-29 Thread Chao Yu
Support .shutdown callback in f2fs_sops, then, it can be called to shut down the file system when underlying block device is marked dead. Signed-off-by: Chao Yu --- fs/f2fs/f2fs.h | 2 ++ fs/f2fs/file.c | 70 ++--- fs/f2fs/super.c | 6 + 3

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

2024-02-29 Thread Chao Yu
Jaegeuk, Daeho, Any comments on this serials? Thanks, On 2024/2/26 9:32, Chao Yu wrote: 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

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

2024-02-29 Thread Chao Yu
On 2024/2/28 1:47, Jaegeuk Kim wrote: On 02/21, Chao Yu wrote: Just cleanup, no functional change. Signed-off-by: Chao Yu --- fs/f2fs/debug.c | 7 +++ fs/f2fs/f2fs.h| 14 -- fs/f2fs/gc.c | 10 +- fs/f2fs/gc.h | 4 ++-- fs/f2fs/segment.c | 12

[f2fs-dev] [PATCH][next] f2fs: Fix two spelling mistakes in f2fs_zone_status array

2024-02-29 Thread Colin Ian King
The array f2fs_zone_status contains two spelling mistakes in literal strings. Fix them. Signed-off-by: Colin Ian King --- fs/f2fs/segment.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index bdb27e4a604b..072c4355d3d3 100644 ---

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

2024-02-29 Thread Geert Uytterhoeven
Hi Chao, On Wed, Feb 21, 2024 at 10:20 AM Chao Yu wrote: > Just cleanup, no functional change. > > Signed-off-by: Chao Yu Thanks for your patch, which is now commit 5fa6a97d27842dab ("f2fs: introduce SEGS_TO_BLKS/BLKS_TO_SEGS for cleanup") in next-20240229. nore...@ell