[f2fs-dev] [PATCH v7] f2fs: fix zoned block device information initialization

2024-04-07 Thread Chao Yu
From: Wenjie Qi If the max open zones of zoned devices are less than the active logs of F2FS, the device may error due to insufficient zone resources when multiple active logs are being written at the same time. Signed-off-by: Wenjie Qi Signed-off-by: Chao Yu --- v7: - check f2fs_sb_has_blkzon

[f2fs-dev] [PATCH 2/2] f2fs: compress: fix to relocate check condition in f2fs_ioc_{, de}compress_file()

2024-04-07 Thread Chao Yu
Compress flag should be checked after inode lock held to avoid racing w/ f2fs_setflags_common() , fix it. Fixes: 5fdb322ff2c2 ("f2fs: add F2FS_IOC_DECOMPRESS_FILE and F2FS_IOC_COMPRESS_FILE") Reported-by: Zhiguo Niu Closes: https://lore.kernel.org/linux-f2fs-devel/cahj8p3ldzxlc2rqeyjvymgyhr2+yl

[f2fs-dev] [PATCH 1/2] f2fs: compress: fix to relocate check condition in f2fs_{release, reserve}_compress_blocks()

2024-04-07 Thread Chao Yu
Compress flag should be checked after inode lock held to avoid racing w/ f2fs_setflags_common(), fix it. Fixes: 4c8ff7095bef ("f2fs: support data compression") Reported-by: Zhiguo Niu Closes: https://lore.kernel.org/linux-f2fs-devel/cahj8p3ldzxlc2rqeyjvymgyhr2+yluj0slg9ddsjzmwo7de...@mail.gmail.

Re: [f2fs-dev] [PATCH 1/2] f2fs: fix to relocate check condition in f2fs_fallocate()

2024-04-07 Thread Chao Yu
On 2024/4/7 10:11, Zhiguo Niu wrote: On Wed, Apr 3, 2024 at 10:26 PM Chao Yu wrote: compress and pinfile flag should be checked after inode lock held to avoid race condition, fix it. Fixes: 4c8ff7095bef ("f2fs: support data compression") Fixes: 5fed0be8583f ("f2fs: do not allow partial trunca

Re: [f2fs-dev] [PATCH 1/2] f2fs: fix to relocate check condition in f2fs_fallocate()

2024-04-07 Thread Zhiguo Niu
On Sun, Apr 7, 2024 at 3:29 PM Chao Yu wrote: > > On 2024/4/7 10:11, Zhiguo Niu wrote: > > On Wed, Apr 3, 2024 at 10:26 PM Chao Yu wrote: > >> > >> compress and pinfile flag should be checked after inode lock held to > >> avoid race condition, fix it. > >> > >> Fixes: 4c8ff7095bef ("f2fs: support

[f2fs-dev] [PATCH] f2fs: fix some ambiguous comments

2024-04-07 Thread Zhiguo Niu
Some comments are confused and just correct with block size is 4KB. Signed-off-by: Zhiguo Niu --- include/linux/f2fs_fs.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/linux/f2fs_fs.h b/include/linux/f2fs_fs.h index a357287..4a56d18 100644 --- a/include/linux/f

[f2fs-dev] [PATCH 1/2] f2fs: use per-log target_bitmap to improve lookup performace of ssr allocation

2024-04-07 Thread Chao Yu
After commit 899fee36fac0 ("f2fs: fix to avoid data corruption by forbidding SSR overwrite"), valid block bitmap of current openned segment is fixed, let's introduce a per-log bitmap instead of temp bitmap to avoid unnecessary calculation overhead whenever allocating free slot w/ SSR allocator. Si

[f2fs-dev] [PATCH 2/2] f2fs: introduce written_map to indicate written datas

2024-04-07 Thread Chao Yu
Currently, __exchange_data_block() will check checkpointed state of data, if it is not checkpointed, it will try to exchange blkaddrs directly in dnode. However, after commit 899fee36fac0 ("f2fs: fix to avoid data corruption by forbidding SSR overwrite"), in order to disallow SSR allocator to reus

[f2fs-dev] [PATCH v2 2/2] f2fs: introduce written_map to indicate written datas

2024-04-07 Thread Chao Yu
Currently, __exchange_data_block() will check checkpointed state of data, if it is not checkpointed, it will try to exchange blkaddrs directly in dnode. However, after commit 899fee36fac0 ("f2fs: fix to avoid data corruption by forbidding SSR overwrite"), in order to disallow SSR allocator to reus

[f2fs-dev] [PATCH v2 1/2] f2fs: use per-log target_bitmap to improve lookup performace of ssr allocation

2024-04-07 Thread Chao Yu
After commit 899fee36fac0 ("f2fs: fix to avoid data corruption by forbidding SSR overwrite"), valid block bitmap of current openned segment is fixed, let's introduce a per-log bitmap instead of temp bitmap to avoid unnecessary calculation overhead whenever allocating free slot w/ SSR allocator. Si

[f2fs-dev] [PATCH v3] f2fs: zone: don't block IO if there is remained open zone

2024-04-07 Thread Chao Yu
max open zone may be larger than log header number of f2fs, for such case, it doesn't need to wait last IO in previous zone, let's introduce available_open_zone semaphore, and reduce it once we submit first write IO in a zone, and increase it after completion of last IO in the zone. Cc: Daeho Jeon