Re: [f2fs-dev] [PATCH v1] f2fs: Fix discard bug on zoned block devices with 2MiB zone size

2023-03-23 Thread Chao Yu
On 2023/3/24 6:03, Jaegeuk Kim wrote: On 03/23, Chao Yu wrote: On 2023/3/13 17:48, Yonggil Song wrote: When using f2fs on a zoned block device with 2MiB zone size, IO errors occurs because f2fs tries to write data to a zone that has not been reset. The cause is that f2fs tries to discard

Re: [f2fs-dev] [PATCH v2] f2fs: convert to MAX_SBI_FLAG instead of 32 in stat_show()

2023-03-23 Thread Chao Yu
On 2023/3/8 22:06, Yangtao Li wrote: BIW reduce the s_flag array size and make s_flag constant. Signed-off-by: Yangtao Li Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https

Re: [f2fs-dev] [PATCH] f2fs: fix to handle filemap_fdatawrite() error in f2fs_ioc_decompress_file/f2fs_ioc_compress_file

2023-03-23 Thread Chao Yu
On 2023/3/2 17:55, Yangtao Li wrote: It seems inappropriate that the current logic does not handle filemap_fdatawrite() errors, so let's fix it. Signed-off-by: Yangtao Li Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs

Re: [f2fs-dev] [PATCH v1] f2fs: Fix discard bug on zoned block devices with 2MiB zone size

2023-03-23 Thread Chao Yu
On 2023/3/13 17:48, Yonggil Song wrote: When using f2fs on a zoned block device with 2MiB zone size, IO errors occurs because f2fs tries to write data to a zone that has not been reset. The cause is that f2fs tries to discard multiple zones at once. This is caused by a condition in

Re: [f2fs-dev] [PATCH] f2fs: handle dqget error in f2fs_transfer_project_quota()

2023-03-23 Thread Chao Yu
+Shilong, Hi, Shilong, Could you please help to check this patch? in original patch, it tries to ignore such error intentionally? or it is a bug? On 2023/2/21 22:45, Yangtao Li wrote: We should set the error code when dqget() failed. Fixes: 2c1d03056991 ("f2fs: support

Re: [f2fs-dev] [PATCH 3/3] f2fs: remove entire rb_entry sharing

2023-03-23 Thread Chao Yu
; }; unsigned long long key; } __packed; Cc: Fixes: 13054c548a1c ("f2fs: introduce infra macro and data structure of rb-tree extent cache") Signed-off-by: Jaegeuk Kim Reviewed-by: Chao Yu Thanks, ___

Re: [f2fs-dev] [PATCH 2/3] f2fs: factor out discard_cmd usage from general rb_tree use

2023-03-23 Thread Chao Yu
; }; unsigned long long key; } __packed; Cc: Fixes: 004b68621897 ("f2fs: use rb-tree to track pending discard commands") Signed-off-by: Jaegeuk Kim Reviewed-by: Chao Y

Re: [f2fs-dev] [PATCH 1/3] f2fs: factor out victim_entry usage from general rb_tree use

2023-03-23 Thread Chao Yu
; }; [16] unsigned long long mtime; [12] unsigned long long key; } __packed; Cc: Fixes: 093749e296e2 ("f2fs: support age threshold based garbage collection") Signed-off-by: Jaegeuk Kim Reviewed-by: Chao Y

Re: [f2fs-dev] [PATCH v2] f2fs: fix uninitialized skipped_gc_rwsem

2023-03-13 Thread Chao Yu
On 2023/3/7 5:51, Jaegeuk Kim wrote: Applied with the below fix. Fixes: 6f8d4455060d ("f2fs: avoid fi->i_gc_rwsem[WRITE] lock in f2fs_gc" ')' was missed. Signed-off-by: Yonggil Song Reviewed-by: Chao Yu Thanks, ___ Lin

Re: [f2fs-dev] [PATCH] f2fs: fix unaligned field offset in 32-bits platform

2023-03-07 Thread Chao Yu
On 2023/3/8 1:26, Jaegeuk Kim wrote: Cc'ed stable. Thanks. Oh, thanks for adding the missed tag! Jaegeuk. Thanks, On 03/07, Chao Yu wrote: F2FS-fs (dm-x): inconsistent rbtree, cur(3470333575168) next(3320009719808) [ cut here ] kernel BUG at fs/f2fs/gc.c:602

Re: [f2fs-dev] [PATCH] f2fs: convert to use bitmap API

2023-03-07 Thread Chao Yu
On 2023/2/16 21:53, Yangtao Li wrote: Let's use BIT() and GENMASK() instead of open it. Signed-off-by: Yangtao Li Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https

Re: [f2fs-dev] [PATCH v2, RESEND] f2fs: export compress_percent and compress_watermark entries

2023-03-07 Thread Chao Yu
On 2023/2/16 22:09, Yangtao Li wrote: This patch export below sysfs entries for better control cached compress page count. /sys/fs/f2fs//compress_watermark /sys/fs/f2fs//compress_percent Signed-off-by: Yangtao Li Reviewed-by: Chao Yu Thanks

[f2fs-dev] [PATCH] f2fs: fix unaligned field offset in 32-bits platform

2023-03-07 Thread Chao Yu
ot;) Fixes: 13054c548a1c ("f2fs: introduce infra macro and data structure of rb-tree extent cache") Fixes: 093749e296e2 ("f2fs: support age threshold based garbage collection") Signed-off-by: Zhiguo Niu Signed-off-by: Chao Yu --- fs/f2fs/f2fs.h | 6 +++--- fs/f2fs/gc.h

Re: [f2fs-dev] [PATCH -next] f2fs: make f2fs_sync_inode_meta() static

2023-03-06 Thread Chao Yu
inode_meta() to static. Signed-off-by: Li Zetao Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Re: [f2fs-dev] [PATCH] f2fs: Fix f2fs_truncate_partial_nodes ftrace event

2023-03-06 Thread Chao Yu
; Instead of 12: field:nid_t nid[3]; offset:24; size:12;signed:0; This also fixes the reported offset of subsequent fields so that they match with the actual struct layout. Signed-off-by: Douglas Raillard Reviewed-by: Chao Yu Thanks

Re: [f2fs-dev] [PATCH] f2fs: drop unnecessary arg for f2fs_ioc_*()

2023-02-15 Thread Chao Yu
On 2023/2/15 14:17, Yangtao Li wrote: They are not used, let's remove them. Signed-off-by: Yangtao Li Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists

Re: [f2fs-dev] [PATCH v1] f2fs: fix uninitialized skipped_gc_rwsem

2023-02-15 Thread Chao Yu
On 2023/2/15 10:48, Yonggil Song wrote: When f2fs skipped a gc round during victim migration, there was a bug which would skip all upcoming gc rounds unconditionally because skipped_gc_rwsem was not initialized. It fixes the bug by correctly initializing the skipped_gc_rwsem inside the gc loop.

Re: [f2fs-dev] [PATCH] f2fs: Revert "f2fs: truncate blocks in batch in __complete_revoke_list()"

2023-02-15 Thread Chao Yu
this. Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Re: [f2fs-dev] [PATCH] f2fs: make kobj_type structures constant

2023-02-15 Thread Chao Yu
On 2023/2/15 2:07, Jaegeuk Kim wrote: On 02/14, Chao Yu wrote: On 2023/2/14 1:51, Jaegeuk Kim wrote: On 02/13, Chao Yu wrote: On 2023/2/9 11:20, Thomas Weißschuh wrote: Since commit ee6d3dd4ed48 ("driver core: make kobj_type constant.") the driver core allows the usage of co

Re: [f2fs-dev] [PATCH] f2fs: synchronize atomic write aborts

2023-02-13 Thread Chao Yu
: 3db1de0e582c ("f2fs: change the current atomic write way") Signed-off-by: Daeho Jeong Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Re: [f2fs-dev] [PATCH] f2fs: synchronize atomic write aborts

2023-02-13 Thread Chao Yu
On 2023/2/14 4:14, Daeho Jeong wrote: diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index 28c9c72dda2a..7bf660d4cad9 100644 --- a/fs/f2fs/inode.c +++ b/fs/f2fs/inode.c @@ -777,11 +777,18 @@ int f2fs_write_inode(struct inode *inode, struct writeback_control *wbc) void f2fs_evict_inode(struct

Re: [f2fs-dev] [PATCH] f2fs: make kobj_type structures constant

2023-02-13 Thread Chao Yu
On 2023/2/14 1:51, Jaegeuk Kim wrote: On 02/13, Chao Yu wrote: On 2023/2/9 11:20, Thomas Weißschuh wrote: Since commit ee6d3dd4ed48 ("driver core: make kobj_type constant.") the driver core allows the usage of const struct kobj_type. Take advantage of this to constify the

Re: [f2fs-dev] [PATCH] f2fs: fix wrong segment count

2023-02-13 Thread Chao Yu
On 2023/2/14 1:48, Jaegeuk Kim wrote: On 02/13, Chao Yu wrote: On 2023/2/11 5:32, Jaegeuk Kim wrote: MAIN_SEGS is for data area, while TOTAL_SEGS includes data and metadata. Good catch! Could you please add fixes line? It seems this is not a bug case, and exisits from the first F2FS patch

Re: [f2fs-dev] [PATCH v3 2/2] f2fs: replace si->sbi w/ sbi in stat_show()

2023-02-13 Thread Chao Yu
On 2023/2/13 22:18, Yangtao Li wrote: For each loop add a local f2fs_sb_info pointer insted of looking it up. Signed-off-by: Yangtao Li Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https

Re: [f2fs-dev] [PATCH v3 1/2] f2fs: export ipu policy in debugfs

2023-02-13 Thread Chao Yu
On 2023/2/13 22:18, Yangtao Li wrote: Export ipu_policy as a string in debugfs for better readability and it can help us better understand some strategies of the file system. Signed-off-by: Yangtao Li Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs

Re: [f2fs-dev] [PATCH] mkfs.f2fs: trim all the devices except the first one

2023-02-13 Thread Chao Yu
On 2023/2/9 5:25, Jaegeuk Kim wrote: We need to check the first disk only, and trim the other disks. I'm confused, why we don't need to trim first disk? Thanks, Signed-off-by: Jaegeuk Kim --- mkfs/f2fs_format_utils.c | 4 1 file changed, 4 insertions(+) diff --git

Re: [f2fs-dev] [PATCH] f2fs: synchronize atomic write aborts

2023-02-13 Thread Chao Yu
On 2023/2/10 2:18, Daeho Jeong wrote: From: Daeho Jeong To fix a race condition between atomic write aborts, I use the inode lock and make COW inode to be re-usable thoroughout the whole atomic file inode lifetime. Reported-by: syzbot+823000d23b3400619...@syzkaller.appspotmail.com Fixes:

Re: [f2fs-dev] [PATCH] f2fs-tools: fix # of total segments

2023-02-13 Thread Chao Yu
On 2023/2/11 5:34, Jaegeuk Kim wrote: TOTAL_SEGS should include metadata segments and main segments. Signed-off-by: Jaegeuk Kim Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https

Re: [f2fs-dev] [PATCH] f2fs: fix wrong segment count

2023-02-13 Thread Chao Yu
On 2023/2/11 5:32, Jaegeuk Kim wrote: MAIN_SEGS is for data area, while TOTAL_SEGS includes data and metadata. Good catch! Could you please add fixes line? Thanks, Signed-off-by: Jaegeuk Kim --- fs/f2fs/segment.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

Re: [f2fs-dev] [PATCH v2] f2fs: export ipu policy in debugfs

2023-02-13 Thread Chao Yu
On 2023/2/10 18:42, Yangtao Li wrote: Export ipu_policy as a string in debugfs for better readability and it can help us better understand some strategies of the file system. Oh, I missed v2, how about making another patch to replace si->sbi w/ sbi? Thanks,

Re: [f2fs-dev] [PATCH] f2fs: export ipu policy in debugfs

2023-02-13 Thread Chao Yu
On 2023/2/10 1:26, Jaegeuk Kim wrote: On 02/09, Yangtao Li wrote: Export ipu_policy as a string in debugfs for better readability and it can help us better understand some strategies of the file system. Since we use ipu_policy as a bitmap, and the bitmap API parameter is unsigned long type

Re: [f2fs-dev] [PATCH] f2fs: make kobj_type structures constant

2023-02-13 Thread Chao Yu
by: Thomas Weißschuh Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

[f2fs-dev] [PATCH v2] f2fs: fix to do sanity check on extent cache correctly

2023-02-07 Thread Chao Yu
In do_read_inode(), sanity check for extent cache should be called after f2fs_init_read_extent_tree(), fix it. Fixes: 728400a1 ("f2fs: allocate the extent_cache by default") Signed-off-by: Chao Yu --- v2: - just relocate sanity check on extent cache. fs/f2fs/extent_ca

Re: [f2fs-dev] [PATCH] f2fs_io: support AES_256_HCTR2

2023-02-07 Thread Chao Yu
On 2023/2/7 10:47, Jaegeuk Kim wrote: Signed-off-by: Jaegeuk Kim Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Re: [f2fs-dev] [PATCH v4 1/3] f2fs: fix to set ipu policy

2023-02-07 Thread Chao Yu
ranularity = MIN_DISCARD_GRANULARITY; + if (!f2fs_lfs_mode(sbi)) + SM_I(sbi)->ipu_policy = BIT(F2FS_IPU_FORCE) | BIT(F2FS_IPU_HONOR_OPU_WRITE); SM_I(sbi)->ipu_policy = BIT(F2FS_IPU_FORCE) | BIT(F2FS

Re: [f2fs-dev] [PATCH] f2fs: fix typos in comments

2023-02-07 Thread Chao Yu
On 2023/2/6 19:56, Jinyoung CHOI wrote: This patch is to fix typos in f2fs files. Signed-off-by: Jinyoung Choi Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net

Re: [f2fs-dev] [PATCH] f2fs: fix kernel crash due to null io->bio

2023-02-07 Thread Chao Yu
x4c/0xf0 [f2fs] ? __pfx_autoremove_wake_function+0x10/0x10 kthread+0xff/0x130 ? __pfx_kthread+0x10/0x10 ret_from_fork+0x2c/0x50 Cc: sta...@vger.kernel.org # v5.18+ Fixes: 64bf0eef0171 ("f2fs: pass the bio operation to bio_alloc_bioset") Signed-off-by: Jaegeuk Kim Reviewe

Re: [f2fs-dev] [PATCH] f2fs-tools: Remove deprecated f2fstat

2023-02-07 Thread Chao Yu
On 2023/2/6 11:42, Jaegeuk Kim wrote: Let's remove this. Signed-off-by: Jaegeuk Kim Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs

Re: [f2fs-dev] [PATCH 1/3] f2fs: clean up __update_extent_tree_range()

2023-02-07 Thread Chao Yu
On 2023/2/6 11:41, Jaegeuk Kim wrote: On 02/01, Chao Yu wrote: On 2023/2/1 2:56, Jaegeuk Kim wrote: I wanted to avoid a deep if/else statement. So how about this: Nothing impressive. Oops... Thanks, ___ Linux-f2fs-devel mailing list Linux

Re: [f2fs-dev] [PATCH 2/2 v4] f2fs: add sysfs nodes to set last_age_weight

2023-02-07 Thread Chao Yu
(struct f2fs_attr *a, return count; } + if (!strcmp(a->attr.name, "last_age_weight")) { + if (t < 0 || t > 100) t is unsigned long variable, should never be less than 0. Otherwise, it looks good to me, maybe Jaegeuk could fix it manually. Re

Re: [f2fs-dev] [PATCH v3 2/3] f2fs: add missing description for ipu_policy node

2023-02-03 Thread Chao Yu
On 2023/2/2 16:48, Yangtao Li wrote: IPU policy can be disabled, let's add description for it and other policy. Signed-off-by: Yangtao Li Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net

Re: [f2fs-dev] [PATCH v3 1/3] f2fs: fix to set ipu policy

2023-02-03 Thread Chao Yu
On 2023/2/2 16:48, Yangtao Li wrote: For LFS mode, it should update outplace and no need inplace update. When using LFS mode for small-volume devices, IPU will not be used, and the OPU writing method is actually used, but F2FS_IPU_FORCE can be read from the ipu_policy node, which is different

Re: [f2fs-dev] [PATCH] f2fs: fix cgroup writeback accounting with fs-layer encryption

2023-02-03 Thread Chao Yu
the pagecache page to wbc_account_cgroup_owner(). Fixes: 578c647879f7 ("f2fs: implement cgroup writeback support") Cc: sta...@vger.kernel.org Reported-by: Matthew Wilcox (Oracle) Signed-off-by: Eric Biggers Reviewed-by: Chao Yu Thanks, ___

Re: [f2fs-dev] [PATCH 2/2 v3] f2fs: add sysfs nodes to set last_age_weight

2023-02-03 Thread Chao Yu
On 2023/2/2 16:20, qixiaoyu1 wrote: Signed-off-by: qixiaoyu1 Signed-off-by: xiongping1 --- Documentation/ABI/testing/sysfs-fs-f2fs | 5 + fs/f2fs/extent_cache.c | 15 +-- fs/f2fs/f2fs.h | 1 + fs/f2fs/sysfs.c

Re: [f2fs-dev] [PATCH 1/2 v3] f2fs: fix wrong calculation of block age

2023-02-02 Thread Chao Yu
On 2023/2/2 16:20, qixiaoyu1 wrote: Currently we wrongly calculate the new block age to old * LAST_AGE_WEIGHT / 100. Fix it to new * (100 - LAST_AGE_WEIGHT) / 100 + old * LAST_AGE_WEIGHT / 100. Signed-off-by: qixiaoyu1 Signed-off-by: xiongping1 Reviewed-by: Chao Yu

[f2fs-dev] [PATCH] fsck.f2fs: relocate chksum verification step during f2fs_do_mount()

2023-02-01 Thread Chao Yu
Keep sanity_check_raw_super flow in fsck.f2fs being consistent w/ sanity_check_raw_super() in f2fs kernel module, otherwise, it outputs different error information when mounting/fscking the same image which contains corrupted superblock. Signed-off-by: Chao Yu --- fsck/mount.c | 8 1

Re: [f2fs-dev] [PATCH v4 1/2] f2fs: use iostat_lat_type directly as a parameter in the iostat_update_and_unbind_ctx()

2023-02-01 Thread Chao Yu
to match the definition. Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Yangtao Li Reviewed-by: Chao Yu Thanks ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists

Re: [f2fs-dev] [PATCH] f2fs: Fix type of single bit bitfield in f2fs_io_info

2023-02-01 Thread Chao Yu
On 2023/2/2 14:15, Nathan Chancellor wrote: On Thu, Feb 02, 2023 at 02:13:18PM +0800, Chao Yu wrote: On 2023/2/2 0:40, Nathan Chancellor wrote: Clang warns: ../fs/f2fs/data.c:995:17: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror

[f2fs-dev] [PATCH v3] f2fs: reduce stack memory cost by using bitfield in struct f2fs_io_info

2023-02-01 Thread Chao Yu
-by: Chao Yu --- v3: - merge Nathan's patch which fixes a compile warning (single-bit-bitfield- constant-conversion). fs/f2fs/checkpoint.c | 6 +++--- fs/f2fs/compress.c | 5 +++-- fs/f2fs/data.c | 10 +- fs/f2fs/f2fs.h | 18 +- fs/f2fs/gc.c | 8

Re: [f2fs-dev] [PATCH] f2fs: Fix type of single bit bitfield in f2fs_io_info

2023-02-01 Thread Chao Yu
On 2023/2/2 0:40, Nathan Chancellor wrote: Clang warns: ../fs/f2fs/data.c:995:17: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion] fio->submitted = 1; ^ ~

Re: [f2fs-dev] [PATCH 1/2 v2] f2fs: fix wrong calculation of block age

2023-02-01 Thread Chao Yu
On 2023/2/1 20:23, qixiaoyu wrote: How about updating as below to avoid lossing accuracy if new is less than 100? return div_u64(new * (100 - LAST_AGE_WEIGHT), 100) + div_u64(old * LAST_AGE_WEIGHT, 100); Thanks, We want to avoid overflow by doing the division first. To keep

Re: [f2fs-dev] [PATCH 1/3] f2fs: clean up __update_extent_tree_range()

2023-02-01 Thread Chao Yu
On 2023/2/1 2:56, Jaegeuk Kim wrote: I wanted to avoid a deep if/else statement. So how about this: From 418b408420367ac5491c97a7c4d26e3d0e68ea57 Mon Sep 17 00:00:00 2001 From: Chao Yu Date: Tue, 31 Jan 2023 22:46:59 +0800 Subject: [PATCH v2] f2fs: clean up __update_extent_tree_range

Re: [f2fs-dev] [PATCH] f2fs: synchronize atomic write aborts

2023-01-31 Thread Chao Yu
Hi Daeho, On 2023/2/1 6:34, Daeho Jeong wrote: On Tue, Jan 31, 2023 at 1:57 PM Daeho Jeong wrote: On Tue, Jan 31, 2023 at 1:38 PM Daeho Jeong wrote: On Tue, Jan 31, 2023 at 11:13 AM Daeho Jeong wrote: Hi Chao, On Tue, Jan 31, 2023 at 3:37 AM Chao Yu wrote: Hi Daeho, On 2023/1/31 0

[f2fs-dev] [PATCH 3/3] f2fs: fix to update age extent in f2fs_do_zero_range()

2023-01-31 Thread Chao Yu
We should update age extent in f2fs_do_zero_range() like we did in f2fs_truncate_data_blocks_range(). Fixes: 71644dff4811 ("f2fs: add block_age-based extent cache") Signed-off-by: Chao Yu --- fs/f2fs/file.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/f2fs/file.c b/fs/f

[f2fs-dev] [PATCH 1/3] f2fs: clean up __update_extent_tree_range()

2023-01-31 Thread Chao Yu
No logic change, just avoid goto statement. Signed-off-by: Chao Yu --- fs/f2fs/extent_cache.c | 66 -- 1 file changed, 31 insertions(+), 35 deletions(-) diff --git a/fs/f2fs/extent_cache.c b/fs/f2fs/extent_cache.c index d70ad6a44cbf..cf65a188d112 100644

[f2fs-dev] [PATCH 2/3] f2fs: fix to update age extent correctly during truncation

2023-01-31 Thread Chao Yu
nr_free may be less than len, we should update age extent cache w/ range [fofs, len] rather than [fofs, nr_free]. Fixes: 71644dff4811 ("f2fs: add block_age-based extent cache") Signed-off-by: Chao Yu --- fs/f2fs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [f2fs-dev] [PATCH] f2fs: synchronize atomic write aborts

2023-01-31 Thread Chao Yu
caching obsolete page? Thanks, Thanks, On Fri, Jan 27, 2023 at 6:07 PM Chao Yu wrote: Hi Daeho, Jaegeuk, Please take a look at patchset in below link: https://lore.kernel.org/linux-f2fs-devel/20230109034453.490176-1-c...@kernel.org/T/#t In PATCH 4/5, I'm trying to fix the same issue w

Re: [f2fs-dev] [PATCH v3] f2fs: retry to update the inode page given EIO

2023-01-30 Thread Chao Yu
...@vger.kernel.org Suggested-by: Randall Huang Suggested-by: Chao Yu Signed-off-by: Jaegeuk Kim Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs

[f2fs-dev] [PATCH] f2fs: clean up parameters of iostat_update_and_unbind_ctx()

2023-01-30 Thread Chao Yu
Parsing sync/rw type from bio inside iostat_update_and_unbind_ctx() to avoid unnecessary parameters. Signed-off-by: Chao Yu --- - this patch is based on [PATCH v3] f2fs: use iostat_lat_type directly as a parameter in the iostat_update_and_unbind_ctx() fs/f2fs/data.c | 4 ++-- fs/f2fs

Re: [f2fs-dev] [PATCH v2 2/5] f2fs: fix to set ipu policy

2023-01-30 Thread Chao Yu
On 2023/1/21 13:12, Yangtao Li wrote: For LFS mode, it should update outplace and no need inplace update. When using LFS mode for small-volume devices, IPU will not be used, and the OPU writing method is actually used, but F2FS_IPU_FORCE can be read from the ipu_policy node, which is different

Re: [f2fs-dev] [PATCH] f2fs: use iostat_lat_type directly as a parameter in the iostat_update_and_unbind_ctx()

2023-01-30 Thread Chao Yu
On 2023/1/31 6:23, Jaegeuk Kim wrote: On 01/30, Jaegeuk Kim wrote: On 01/28, Chao Yu wrote: On 2023/1/5 12:22, Yangtao Li wrote: Convert to use iostat_lat_type as parameter instead of raw number. BTW, move NUM_PREALLOC_IOSTAT_CTXS to the header file, and rename iotype to page_type to match

Re: [f2fs-dev] [PATCH] f2fs: use iostat_lat_type directly as a parameter in the iostat_update_and_unbind_ctx()

2023-01-30 Thread Chao Yu
On 2023/1/31 5:35, Jaegeuk Kim wrote: On 01/28, Chao Yu wrote: On 2023/1/5 12:22, Yangtao Li wrote: Convert to use iostat_lat_type as parameter instead of raw number. BTW, move NUM_PREALLOC_IOSTAT_CTXS to the header file, and rename iotype to page_type to match the definition. Signed-off

Re: [f2fs-dev] [PATCH v3 2/2] f2fs: use iostat_lat_type directly as a parameter in the iostat_update_and_unbind_ctx()

2023-01-30 Thread Chao Yu
On 2023/1/21 0:16, Yangtao Li wrote: Convert to use iostat_lat_type as parameter instead of raw number. BTW, move NUM_PREALLOC_IOSTAT_CTXS to the header file, and rename iotype to page_type to match the definition. Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by:

Re: [f2fs-dev] [PATCH v3 1/2] f2fs: fix to avoid potential memory corruption in __update_iostat_latency()

2023-01-30 Thread Chao Yu
^ Mixup between META_FLUSH and NR_PAGE_TYPE leads to memory corruption. Fixes: a4b6817625e7 ("f2fs: introduce periodic iostat io latency traces") Reported-by: kernel test robot Reported-by: Dan Carpenter Suggested-by: Chao Yu Suggested-by: Jaegeuk Kim Signed-off-by: Yan

[f2fs-dev] [PATCH v2] f2fs: reduce stack memory cost by using bitfield in struct f2fs_io_info

2023-01-29 Thread Chao Yu
;/* require post read */ ... }; After this patch, size of struct f2fs_io_info reduces from 136 to 120. Signed-off-by: Chao Yu --- v2: - fix compile warning caused by assigning bool type value to bitfield variable. fs/f2fs/checkpoint.c | 6 +++--- fs/f2fs/compress.c | 5 +++-- fs/f2fs

[f2fs-dev] [PATCH] f2fs: reduce stack memory cost by using bitfield in struct f2fs_io_info

2023-01-29 Thread Chao Yu
;/* require post read */ ... }; After this patch, size of struct f2fs_io_info reduces from 136 to 120. Signed-off-by: Chao Yu --- fs/f2fs/f2fs.h | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index fa41c0dad308

Re: [f2fs-dev] [PATCH 8/8] f2fs: remove __has_curseg_space

2023-01-29 Thread Chao Yu
On 2023/1/19 14:36, Christoph Hellwig wrote: Just open code the logic in the only caller, where it is more obvious. Signed-off-by: Christoph Hellwig Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel

Re: [f2fs-dev] [PATCH 7/8] f2fs: refactor next blk selection

2023-01-29 Thread Chao Yu
On 2023/1/19 14:36, Christoph Hellwig wrote: Remove __refresh_next_blkoff by opencoding the SSR vs LFS segment check in the only caller, and then add helpers for SSR block selection and blkoff randomization instead. Signed-off-by: Christoph Hellwig Reviewed-by: Chao Yu Thanks

Re: [f2fs-dev] [PATCH 6/8] f2fs: remove __allocate_new_section

2023-01-29 Thread Chao Yu
On 2023/1/19 14:36, Christoph Hellwig wrote: Just fold this trivial wrapper into the only caller. Signed-off-by: Christoph Hellwig Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https

Re: [f2fs-dev] [PATCH 5/8] f2fs: refactor __allocate_new_segment

2023-01-29 Thread Chao Yu
On 2023/1/19 14:36, Christoph Hellwig wrote: Simplify the check whether to allocate a new segment or reuse an open one. Signed-off-by: Christoph Hellwig Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel

Re: [f2fs-dev] [PATCH 4/8] f2fs: factor the read/write tracing logic into a helper

2023-01-29 Thread Chao Yu
On 2023/1/19 14:36, Christoph Hellwig wrote: Factor the logic to log a path for reads and writs into a helper shared between the read_iter and write_iter methods. Signed-off-by: Christoph Hellwig --- fs/f2fs/file.c | 60 +- 1 file changed, 25

Re: [f2fs-dev] [PATCH 3/8] f2fs: add a f2fs_curseg_valid_blocks helper

2023-01-29 Thread Chao Yu
On 2023/1/19 14:36, Christoph Hellwig wrote: Add a helper to return the valid blocks on log and SSR segments, and replace the last two uses of curseg_blkoff with it. Signed-off-by: Christoph Hellwig Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs

Re: [f2fs-dev] [PATCH 2/8] f2fs: simplify do_checkpoint

2023-01-29 Thread Chao Yu
On 2023/1/19 14:36, Christoph Hellwig wrote: For each loop add a local curseg_info pointer insted of looking it up for each of the three fields. Signed-off-by: Christoph Hellwig Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list

Re: [f2fs-dev] [PATCH 1/8] f2fs: remove __add_sum_entry

2023-01-29 Thread Chao Yu
On 2023/1/19 14:36, Christoph Hellwig wrote: This function just assigns a summary entry. This can be done entirely typesafe with an open code struct assignment that relies on array indexing. Signed-off-by: Christoph Hellwig Reviewed-by: Chao Yu Thanks

Re: [f2fs-dev] [PATCH 1/4] f2fs: fix to check lz4hc compression when CONFIG_F2FS_FS_LZ4HC is not enabled

2023-01-29 Thread Chao Yu
On 2023/1/24 23:33, Yangtao Li wrote: f2fs supports lz4 compression algorithm and lz4hc compression algorithm, which the level parameter needs to be passed in. When CONFIG_F2FS_FS_LZ4HC is not enabled, even if there is no problem with the level parameter, add the level parameter to the lz4

Re: [f2fs-dev] [PATCH] f2fs: allow set compression option of files without blocks

2023-01-29 Thread Chao Yu
On 2023/1/23 17:46, Yangtao Li wrote: Files created by truncate have a size but no blocks, so they can be allowed to set compression option. Fixes: e1e8debec656 ("f2fs: add F2FS_IOC_SET_COMPRESS_OPTION ioctl") Signed-off-by: Yangtao Li Reviewed-by: Chao Y

Re: [f2fs-dev] [PATCH] f2fs: fix information leak in f2fs_move_inline_dirents()

2023-01-29 Thread Chao Yu
ed initializing when converting inline dentry") Cc: # v4.3+ Signed-off-by: Eric Biggers Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Re: [f2fs-dev] [PATCH] f2fs: fix shift-out-of-bounds in f2fs_fill_super

2023-01-29 Thread Chao Yu
On 2023/1/29 15:55, Yangtao Li wrote: syzbot reported a bug which could cause shift-out-of-bounds issue: UBSAN: shift-out-of-bounds in fs/f2fs/super.c:4184:41 shift exponent 613 is too large for 64-bit type 'loff_t' (aka 'long long') CPU: 1 PID: 5467 Comm: syz-executor.0 Not tainted

Re: [f2fs-dev] [PATCH] f2fs: convert is_extension_exist() to return bool type

2023-01-28 Thread Chao Yu
On 2023/1/12 22:31, Yangtao Li wrote: is_extension_exist() only return two values, 0 or 1. So there is no need to use int type. It's too trivial to do such change one by one, how about merging all similar changes into one patch? Thanks, Signed-off-by: Yangtao Li --- fs/f2fs/namei.c | 12

Re: [f2fs-dev] [PATCH] f2fs: introduce sanity_check_blocks()

2023-01-28 Thread Chao Yu
On 2023/1/12 22:22, Yangtao Li wrote: There are very similar codes in release_compress_blocks() and reserve_compress_blocks() which is used for data blocks check. This patch introduces a new helper sanity_check_blocks() to include those common codes, and used it instead for cleanup. How about

Re: [f2fs-dev] [PATCH 2/3] f2fs: add F2FS_IOC_SET_COMPRESS_OPTION_V2 ioctl

2023-01-28 Thread Chao Yu
On 2023/1/12 21:35, Yangtao Li wrote: Added a new F2FS_IOC_SET_COMPRESS_OPTION_V2 ioctl to change file compression option of a file. struct f2fs_comp_option_v2 { union { struct { __u8 algorithm; __u8 log_cluster_size;

[f2fs-dev] [PATCH] f2fs: fix to handle F2FS_IOC_START_ATOMIC_REPLACE in f2fs_compat_ioctl()

2023-01-28 Thread Chao Yu
Otherwise, 32-bits binary call ioctl(F2FS_IOC_START_ATOMIC_REPLACE) will fail in 64-bits kernel. Fixes: 41e8f85a75fc ("f2fs: introduce F2FS_IOC_START_ATOMIC_REPLACE") Signed-off-by: Chao Yu --- fs/f2fs/file.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/f2fs/file.c b/fs/f

[f2fs-dev] [PATCH] f2fs: clean up i_compress_flag and i_compress_level usage

2023-01-28 Thread Chao Yu
in-memory .i_compress_flag - change type of in-memory .i_compress_flag from unsigned short to unsigned char. w/ above changes, we can avoid unneeded bit shift whenever during .init_compress_ctx(), and shrink size of struct f2fs_inode_info. Signed-off-by: Chao Yu --- fs/f2fs/compress.c | 8 +++- fs/f

Re: [f2fs-dev] [PATCH 4/4] f2fs: move ipu_policy definitions to separated file

2023-01-28 Thread Chao Yu
On 2023/1/20 21:40, Yangtao Li wrote: User can control f2fs ipu policy through /sys/fs/f2fs//ipu_policy, export related definitions and introduce new macro to make it more convenient for users to use. Signed-off-by: Yangtao Li --- Documentation/ABI/testing/sysfs-fs-f2fs | 25 ++--

Re: [f2fs-dev] [PATCH 3/4] f2fs: introduce ipu_mode sysfs node

2023-01-28 Thread Chao Yu
On 2023/1/20 21:40, Yangtao Li wrote: Add a ipu_mode sysfs node to show the current ipu policy as a string. Why do we need to add another sysfs entry for ipu_policy? we can check the description of ipu_policy bits in below sysfs document. What: /sys/fs/f2fs//ipu_policy Date:

Re: [f2fs-dev] [PATCH 2/4] f2fs: add sanity check for ipu_policy

2023-01-28 Thread Chao Yu
On 2023/1/20 21:40, Yangtao Li wrote: Disallow the value set beyond the range, and disallow to change the value in lfs mode. IMO, it's better to merge this patch into 1/4. BTW, convert open code to use BIT(). How about using one patch to change 1 << xx to BIT(xx) for all cases of f2fs

Re: [f2fs-dev] [PATCH 1/4] f2fs: fix to set ipu policy

2023-01-28 Thread Chao Yu
On 2023/1/20 21:40, Yangtao Li wrote: For LFS mode, it should update outplace and no need inplace update. When using LFS mode for small-volume devices, IPU will not be used, and the OPU writing method is actually used, but F2FS_IPU_FORCE can be read from the ipu_policy node, which is different

Re: [f2fs-dev] [PATCH 1/3] f2fs: clarify compress level bit offset

2023-01-27 Thread Chao Yu
On 2023/1/12 21:34, Yangtao Li wrote: commit 3fde13f817e2 ("f2fs: compress: support compress level") introduce compress level, which macro(COMPRESS_LEVEL_OFFSET) is 8, But use wrong comment about compress level. Let's fix it. Signed-off-by: Yangtao Li Reviewed-by: Chao Y

Re: [f2fs-dev] [PATCH 1/2 v2] f2fs: fix wrong calculation of block age

2023-01-27 Thread Chao Yu
On 2023/1/16 11:08, qixiaoyu1 wrote: Currently we wrongly calculate the new block age to old * LAST_AGE_WEIGHT / 100. Fix it to new * (100 - LAST_AGE_WEIGHT) / 100 + old * LAST_AGE_WEIGHT / 100. Signed-off-by: qixiaoyu1 Signed-off-by: xiongping1 --- Change log v1 -> v2: -

Re: [f2fs-dev] [PATCH] f2fs: use iostat_lat_type directly as a parameter in the iostat_update_and_unbind_ctx()

2023-01-27 Thread Chao Yu
On 2023/1/5 12:22, Yangtao Li wrote: Convert to use iostat_lat_type as parameter instead of raw number. BTW, move NUM_PREALLOC_IOSTAT_CTXS to the header file, and rename iotype to page_type to match the definition. Signed-off-by: Yangtao Li --- fs/f2fs/data.c | 5 +++-- fs/f2fs/iostat.c

Re: [f2fs-dev] [PATCH v2] f2fs: retry to update the inode page given EIO

2023-01-27 Thread Chao Yu
On 2023/1/13 8:01, Jaegeuk Kim wrote: On 01/12, Chao Yu wrote: On 2023/1/12 2:50, Jaegeuk Kim wrote: On 01/11, Chao Yu wrote: On 2023/1/11 9:20, Jaegeuk Kim wrote: In f2fs_update_inode_page, f2fs_get_node_page handles EIO along with f2fs_handle_page_eio that stops checkpoint, if the disk

Re: [f2fs-dev] [PATCH] f2fs: synchronize atomic write aborts

2023-01-27 Thread Chao Yu
Hi Daeho, Jaegeuk, Please take a look at patchset in below link: https://lore.kernel.org/linux-f2fs-devel/20230109034453.490176-1-c...@kernel.org/T/#t In PATCH 4/5, I'm trying to fix the same issue w/ alternative way, let me know your preference. :) One comment as below. On 2023/1/13 8:49,

Re: [f2fs-dev] [PATCH v2 1/2] f2fs: fix to avoid potential memory corruption in __update_iostat_latency()

2023-01-16 Thread Chao Yu
On 2023/1/16 21:02, Yangtao Li wrote: Add iotype sanity check to avoid potential memory corruption. This is to fix the compile error below: fs/f2fs/iostat.c:231 __update_iostat_latency() error: buffer overflow 'io_lat->peak_lat[type]' 3 <= 3 vim +228 fs/f2fs/iostat.c 211 static inline

Re: [f2fs-dev] [PATCH v5 14/23] f2fs: Convert f2fs_write_cache_pages() to use filemap_get_folios_tag()

2023-01-12 Thread Chao Yu
to be after the last found folio, not necessarily the last used page. Signed-off-by: Vishal Moola (Oracle) Acked-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo

Re: [f2fs-dev] [PATCH v2] f2fs: retry to update the inode page given EIO

2023-01-12 Thread Chao Yu
On 2023/1/12 2:50, Jaegeuk Kim wrote: On 01/11, Chao Yu wrote: On 2023/1/11 9:20, Jaegeuk Kim wrote: In f2fs_update_inode_page, f2fs_get_node_page handles EIO along with f2fs_handle_page_eio that stops checkpoint, if the disk couldn't be recovered. As a result, we don't need to stop checkpoint

Re: [f2fs-dev] [PATCH 1/4] f2fs: reset iostat_count in f2fs_reset_iostat()

2023-01-11 Thread Chao Yu
i->iostat_bytes[type], \ + sbi->iostat_count[type], \ + iostat_get_avg_bytes(sbi, type)) \ '\' doesn't align in column, otherwise it looks good to me. Reviewed-by: Chao Yu Thanks, ___

Re: [f2fs-dev] [PATCH v3] f2fs: introduce discard_io_aware_gran sysfs node

2023-01-11 Thread Chao Yu
On 2023/1/4 19:40, Yangtao Li wrote: The current discard_io_aware_gran is a fixed value, change it to be configurable through the sys node. Signed-off-by: Yangtao Li --- v3: remove DEFAULT_IO_AWARE_DISCARD_GRANULARITY Documentation/ABI/testing/sysfs-fs-f2fs | 9 + fs/f2fs/f2fs.h

Re: [f2fs-dev] [PATCH] f2fs: convert discard_wake and gc_wake to bool type

2023-01-11 Thread Chao Yu
: - sizeof(struct discard_cmd_control): 8384 Signed-off-by: Yangtao Li Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Re: [f2fs-dev] [PATCH] f2fs: convert to use MIN_DISCARD_GRANULARITY macro

2023-01-11 Thread Chao Yu
On 2022/12/17 13:24, Yangtao Li wrote: Commit 1cd2e6d54435 ("f2fs: define MIN_DISCARD_GRANULARITY macro") introduce it, let's convert to use MIN_DISCARD_GRANULARITY macro. Signed-off-by: Yangtao Li Reviewed-by: Chao Yu Thanks, ___

Re: [f2fs-dev] [PATCH v3] f2fs: merge f2fs_show_injection_info() into time_to_inject()

2023-01-11 Thread Chao Yu
, we no longer need the f2fs_show_injection_info() function, and let's remove it. Suggested-by: Chao Yu Signed-off-by: Yangtao Li Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https

<    4   5   6   7   8   9   10   11   12   13   >