Re: [f2fs-dev] a fix and a bunch of cleanups

2023-01-05 Thread Chao Yu
Jaegeuk, please help to add my rvb tag for all patches in this set. :) Reviewed-by: Chao Yu Thanks, Thanks, On 11/28, Christoph Hellwig wrote: Hi Jaegeuk and Chao, the first patch in this series fixes a warning and subsequent hang when testing zoned f2fs. The other patches are misc clea

Re: [f2fs-dev] Fwd: f2fs write error Linux v6.2

2022-12-30 Thread Chao Yu
Hi Jeff, On 2022/12/30 14:39, Eric Biggers wrote: If you could provide the mkfs and mount options you are using, and any other relevant details, that would be helpful. Bisection would also be very helpful, as Thorsten mentioned. Other than that, I found some cases which can cause similar issu

[f2fs-dev] [PATCH] f2fs: fix to avoid NULL pointer dereference in f2fs_issue_flush()

2022-12-30 Thread Chao Yu
=4k count=1 conv=fsync In order to fix this issue, let change as below: - fix error path handling in f2fs_create_flush_cmd_control(). - allocate SM_I(sbi)->fcc_info even if readonly is on. Signed-off-by: Chao Yu --- fs/f2fs/segment.c | 11 --- 1 file changed, 4 insertions(+), 7 deleti

[f2fs-dev] [PATCH] f2fs: fix error path of f2fs_create_flush_cmd_control()

2022-12-30 Thread Chao Yu
emount,flush_merge /dev/vda /mnt/f2fs -- kthread_run() fails - dd if=/dev/zero of=/mnt/f2fs/file bs=4k count=1 conv=fsync Signed-off-by: Chao Yu --- fs/f2fs/segment.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 2646575f43de..7b18e8

Re: [f2fs-dev] [PATCH REPOST] f2fs: file: drop useless initializer in expand_inode_data()

2022-12-21 Thread Chao Yu
Hi all, On 2022/12/21 11:30, Yangtao Li wrote: Hi Sergey, In expand_inode_data(), the 'new_size' local variable is initialized to the result of i_size_read(), however this value isn't ever used, so we can drop this initializer... Found by Linux Verification Center (linuxtesting.org) with the

Re: [f2fs-dev] [PATCH REPOST] f2fs: file: drop useless initializer in expand_inode_data()

2022-12-21 Thread Chao Yu
he SVACE static analysis tool. Signed-off-by: Sergey Shtylyov 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: remove unused PAGE_PRIVATE_ATOMIC_WRITE

2022-12-21 Thread Chao Yu
On 2022/12/21 11:59, Yangtao Li wrote: PAGE_PRIVATE_GET_FUNC(reference, REF_RESOURCE); PAGE_PRIVATE_CLEAR_FUNC(reference, REF_RESOURCE); Delete those two too? Oh, thank for checking PAGE_PRIVATE_REF_RESOURCE's usage, I found we need clear_page_private_reference(), see “[PATCH] f2fs: f

[f2fs-dev] [PATCH] f2fs: fix to support .migrate_folio for compressed inode

2022-12-21 Thread Chao Yu
Add missed .migrate_folio for compressed inode, in order to support migration of compressed inode's page. Signed-off-by: Chao Yu --- fs/f2fs/compress.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c index 2532f369cb10..719b0a0184b0 100644 ---

[f2fs-dev] [PATCH] f2fs: fix to call clear_page_private_reference in .{release, invalid}_folio

2022-12-21 Thread Chao Yu
e. BTW, remove page_private_reference() definition as it never be used. Signed-off-by: Chao Yu --- fs/f2fs/data.c | 2 ++ fs/f2fs/f2fs.h | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index b1ec0fbf1c8f..53d8945df2c1 100644 --- a/fs/f2fs/data.c +++ b

[f2fs-dev] [PATCH] f2fs: remove unused PAGE_PRIVATE_ATOMIC_WRITE

2022-12-20 Thread Chao Yu
Commit 3db1de0e582c ("f2fs: change the current atomic write way") has removed all users of PAGE_PRIVATE_ATOMIC_WRITE, remove its definition and related functions. Signed-off-by: Chao Yu --- fs/f2fs/f2fs.h | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff

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

2022-12-19 Thread Chao Yu
On 2022/12/19 21:25, Yangtao Li wrote: There is no need to additionally use f2fs_show_injection_info() to output information. Concatenate time_to_inject() and __time_to_inject() via a macro. In the new __time_to_inject() function, pass in the caller function name. And in order to avoid this inlin

Re: [f2fs-dev] [PATCH] f2fs: maintain discard in separated file

2022-12-19 Thread Chao Yu
On 2022/12/17 21:23, Yangtao Li wrote: This patch moves discard related code from segment.c into discard.c since discard is independent feature, and it's better to maintain them in separated place. There is no functionality change. Please check Jaegeuk's comments on similar patch: https://lor

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

2022-12-16 Thread Chao Yu
On 2022/12/17 3:32, Yangtao Li wrote: Hi Chao, After moving f2fs_show_injection_info() core functionality into time_to_inject(), __builtin_return_address(0) result changes from return address of caller of f2fs_show_injection_info() to return address of time_to_inject(). It seems you are wron

[f2fs-dev] [PATCH] f2fs: fix to avoid potential deadlock

2022-12-16 Thread Chao Yu
a90c9e5a7 ("f2fs: support recording errors into superblock") Link: https://lore.kernel.org/linux-f2fs-devel/cd5fe305ef617...@google.com/T/#u Reported-by: syzbot+4793f6096d174c90b...@syzkaller.appspotmail.com Signed-off-by: Chao Yu --- fs/f2fs/file.c | 9 ++--- 1 file chan

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

2022-12-16 Thread Chao Yu
On 2022/12/16 11:48, Yangtao Li wrote: After moving f2fs_show_injection_info() core functionality into time_to_inject(), __builtin_return_address(0) result changes from return address of caller of f2fs_show_injection_info() to return address of time_to_inject(). I tried the __builtin_return_ad

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

2022-12-15 Thread Chao Yu
On 2022/12/15 20:20, Yangtao Li wrote: There is no need to additionally use f2fs_show_injection_info() to output information. Concatenate time_to_inject() and __time_to_inject() via a macro. In the new __time_to_inject() function, pass in the caller function name. In this way, we no longer need

Re: [f2fs-dev] [PATCH v2] f2fs: add support for counting time of submit discard cmd

2022-12-15 Thread Chao Yu
On 2022/12/15 5:52, Jaegeuk Kim wrote: https://korg.wiki.kernel.org/userdoc/patchwork#adding_patchwork-bot_integration Good idea. I requested to add f2fs project there. :) Let's see. The website is available now, cool... :) https://patchwork.kernel.org/project/f2fs/ Jaegeuk, your email addr

[f2fs-dev] [PATCH v2] f2fs: add missing doc for fault injection sysfs

2022-12-15 Thread Chao Yu
t injection per superblock") /sys/fs/f2fs//fault_* Cc: Sheng Yong Signed-off-by: Chao Yu --- v2: - fix to handle merge conflict correctly. Documentation/ABI/testing/sysfs-fs-f2fs | 39 + 1 file changed, 39 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-fs-f2fs

Re: [f2fs-dev] [PATCH] f2fs: add missing doc for fault injection sysfs

2022-12-15 Thread Chao Yu
On 2022/12/15 22:14, Yangtao Li wrote: Hi Chao, -What: /sys/fs/f2fs//gc_mode -Date: October 2022 -Contact: "Yangtao Li" -Description: Show the current gc_mode as a string. - This is a read-only entry. -What: /sys/fs/f2fs//discard_urgent_util

[f2fs-dev] [PATCH] f2fs: add missing doc for fault injection sysfs

2022-12-15 Thread Chao Yu
t injection per superblock") /sys/fs/f2fs//fault_* Cc: Sheng Yong Signed-off-by: Chao Yu --- Documentation/ABI/testing/sysfs-fs-f2fs | 63 +++-- 1 file changed, 37 insertions(+), 26 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-fs-f2fs b/Documentation/ABI/testing

[f2fs-dev] [PATCH] f2fs: avoid to check PG_error flag

2022-12-14 Thread Chao Yu
n f2fs, as a step towards freeing the PG_error flag for other uses. Cc: Eric Biggers Signed-off-by: Chao Yu --- fs/f2fs/data.c| 2 -- fs/f2fs/gc.c | 1 - fs/f2fs/inline.c | 1 - fs/f2fs/node.c| 3 --- fs/f2fs/segment.c | 1 - 5 files changed, 8 deletions(-) diff --git a/fs/f2fs/data

Re: [f2fs-dev] [PATCH v3] f2fs: deliver the accumulated 'issued' to __issue_discard_cmd_orderly() to meet the max_requests limit

2022-12-14 Thread Chao Yu
code part, it looks good to me. Reviewed-by: Chao Yu Thanks, --- fs/f2fs/segment.c | 24 +++- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index a9099a754dd2..5268938466f5 100644 --- a/fs/f2fs/segment.c +++ b/fs

Re: [f2fs-dev] [PATCH] f2fs: fix iostat parameter for discard

2022-12-14 Thread Chao Yu
On 2022/12/14 3:11, Jaegeuk Kim wrote: On 12/13, Yangtao Li wrote: What do you think of extending this function to support io_counts? void f2fs_update_iostat(struct f2fs_sb_info *sbi, struct inode *inode, enum iostat_type type, unsigned long long io_bytes,

Re: [f2fs-dev] [RFC PATCH] f2fs: Convert f2fs_write_cache_pages() to use filemap_get_folios_tag()

2022-12-14 Thread Chao Yu
On 2022/12/13 3:13, Vishal Moola (Oracle) wrote: Converted the function to use a folio_batch instead of pagevec. This is in preparation for the removal of find_get_pages_range_tag(). Also modified f2fs_all_cluster_page_ready to take in a folio_batch instead of pagevec. This does NOT support larg

Re: [f2fs-dev] [PATCH] f2fs: do some cleanup for f2fs module init

2022-12-12 Thread Chao Yu
On 2022/12/13 9:37, Jaegeuk Kim wrote: On 12/13, Chao Yu wrote: On 2022/12/13 6:53, Jaegeuk Kim wrote: On 12/11, Chao Yu wrote: On 2022/11/25 19:47, Yangtao Li wrote: Just for cleanup, no functional changes. Signed-off-by: Yangtao Li --- fs/f2fs/compress.c | 46

Re: [f2fs-dev] [PATCH] f2fs: fix iostat parameter for discard

2022-12-12 Thread Chao Yu
On 2022/12/13 6:59, Jaegeuk Kim wrote: On 12/11, Chao Yu wrote: On 2022/12/5 22:56, Yangtao Li wrote: Just like other data we count uses the number of bytes as the basic unit, but discard uses the number of cmds as the statistical unit. In fact the discard command contains the number of blocks

Re: [f2fs-dev] [PATCH] f2fs: do some cleanup for f2fs module init

2022-12-12 Thread Chao Yu
On 2022/12/13 6:53, Jaegeuk Kim wrote: On 12/11, Chao Yu wrote: On 2022/11/25 19:47, Yangtao Li wrote: Just for cleanup, no functional changes. Signed-off-by: Yangtao Li --- fs/f2fs/compress.c | 46 ++ fs/f2fs/data.c | 14

Re: [f2fs-dev] [PATCH v2] f2fs: don't call f2fs_issue_discard_timeout() when discard_cmd_cnt is 0 in f2fs_put_super()

2022-12-12 Thread Chao Yu
On 2022/12/13 6:45, Jaegeuk Kim wrote: On 12/12, Chao Yu wrote: On 2022/12/12 22:14, Yangtao Li wrote: Hi Chao, The difference here is, if we use f2fs_realtime_discard_enable() in f2fs_put_super(), we will only write checkpoint w/ CP_TRIMMED flag when discard option is enable and device

Re: [f2fs-dev] [PATCH v2] f2fs: add support for counting time of submit discard cmd

2022-12-12 Thread Chao Yu
On 2022/12/13 6:47, Jaegeuk Kim wrote: On 12/12, Chao Yu wrote: On 2022/12/12 20:51, Yangtao Li wrote: This patch adds support for counting the average time and peak time of submit discard command, and we can see its value in debugfs. It is not sure whether the block layer has recorded these

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

2022-12-12 Thread Chao Yu
Hi Vishal, Sorry for the delay reply. On 2022/12/6 4:34, Vishal Moola wrote: On Tue, Nov 22, 2022 at 6:26 PM Vishal Moola wrote: On Mon, Nov 14, 2022 at 1:38 PM Vishal Moola wrote: On Sun, Nov 13, 2022 at 11:02 PM Chao Yu wrote: On 2022/10/18 4:24, Vishal Moola (Oracle) wrote

Re: [f2fs-dev] [PATCH v2] f2fs: don't call f2fs_issue_discard_timeout() when discard_cmd_cnt is 0 in f2fs_put_super()

2022-12-12 Thread Chao Yu
On 2022/12/12 22:14, Yangtao Li wrote: Hi Chao, The difference here is, if we use f2fs_realtime_discard_enable() in f2fs_put_super(), we will only write checkpoint w/ CP_TRIMMED flag when discard option is enable and device supports discard. But actually, if discard option is disabled, we st

Re: [f2fs-dev] [PATCH v2] f2fs: don't call f2fs_issue_discard_timeout() when discard_cmd_cnt is 0 in f2fs_put_super()

2022-12-12 Thread Chao Yu
On 2022/12/12 21:05, Yangtao Li wrote: Hi, static inline bool f2fs_realtime_discard_enable(struct f2fs_sb_info *sbi) { return (test_opt(sbi, DISCARD) && f2fs_hw_support_discard(sbi)) || f2fs_hw_should_discard(sbi); } It looks the logic is chang

Re: [f2fs-dev] [PATCH v2] f2fs: add support for counting time of submit discard cmd

2022-12-12 Thread Chao Yu
On 2022/12/12 20:51, Yangtao Li wrote: This patch adds support for counting the average time and peak time of submit discard command, and we can see its value in debugfs. It is not sure whether the block layer has recorded these data, and these data are allowed to be accessed by fs, or they are

Re: [f2fs-dev] [PATCH] f2fs: don't set FI_COMPRESS_RELEASED if file is not compressed

2022-12-12 Thread Chao Yu
On 2022/12/10 4:19, Jaegeuk Kim wrote: On 12/08, zhoudan8 wrote: In compress_mode=user, f2fs_release_compress_blocks() does not verify whether it has been compressed and sets FI_COMPRESS_RELEASED directly. which will lead to return -EINVAL after calling compress. To fix it,let's do not set F

Re: [f2fs-dev] [PATCH 2/2] f2fs: add support for counting the average time of submit discard cmd

2022-12-12 Thread Chao Yu
On 2022/11/29 12:15, Yangtao Li wrote: This patch adds support for counting the average time of submit discard command, and we can see its value in debugfs. How about enabling this only when CONFIG_DEBUG_FS is on? +Cc block mailing list Not sure block layer has similar stats? if it hasn't, ca

Re: [f2fs-dev] [PATCH v2] f2fs: reset wait_ms to default if any of the victims have been selected

2022-12-12 Thread Chao Yu
configuration of wait_ms is not reasonable. After any of the victims have been selected, we need to reset wait_ms to default sleep time from no_gc_sleep_time. Signed-off-by: Yuwei Guan Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list

Re: [f2fs-dev] [PATCH] f2fs: add iostat support for FS_DISCARD_IO

2022-12-12 Thread Chao Yu
x27;s keeping FS_DISCARD as it is, and add FS_DISCARD_IO to account discard bytes. 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

Re: [f2fs-dev] [PATCH v4 16/23] f2fs: Convert f2fs_sync_meta_pages() to use filemap_get_folios_tag()

2022-12-10 Thread Chao Yu
indexing bounds we can simply ignore the check for that specific index. This makes the initial assignment of prev trivial, so I removed that as well. Also modified a comment in commit_checkpoint for consistency. Signed-off-by: Vishal Moola (Oracle) Acked-by: Chao Yu

Re: [f2fs-dev] [PATCH v4 15/23] f2fs: Convert last_fsync_dnode() to use filemap_get_folios_tag()

2022-12-10 Thread Chao Yu
On 2022/11/3 0:10, Vishal Moola (Oracle) wrote: Convert to use a folio_batch instead of pagevec. This is in preparation for the removal of find_get_pages_range_tag(). Signed-off-by: Vishal Moola (Oracle) Acked-by: Chao Yu Thanks, ___ Linux-f2fs

Re: [f2fs-dev] [PATCH] f2fs: Fix spelling mistake in label: free_bio_enrty_cache -> free_bio_entry_cache

2022-12-10 Thread Chao Yu
On 2022/12/7 21:42, Colin Ian King wrote: There is a spelling mistake in a label name. Fix it. Signed-off-by: Colin Ian King Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https

Re: [f2fs-dev] [PATCH] f2fs: do decrease_sleep_time() if any of the victims have been selected

2022-12-10 Thread Chao Yu
On 2022/12/9 19:28, Yuwei Guan wrote: In non-foreground gc mode, if no victim is selected, the gc process will wait for no_gc_sleep_time before waking up again. In this subsequent time, even though a victim will be selected, the gc process still waits for no_gc_sleep_time before waking up. The co

Re: [f2fs-dev] [PATCH] f2fs: continuous counting for 'issued' in __issue_discard_cmd_orderly()

2022-12-10 Thread Chao Yu
On 2022/11/22 0:11, Yuwei Guan wrote: As the 'dcc->discard_granularity' and 'dcc->max_ordered_discard' can be set at the user space, and if the 'dcc->max_ordered_discard' is set larger than 'dcc->discard_granularity' in DPOLICY_BG mode, or it's a volume device, discard_granularity can be tuned to

Re: [f2fs-dev] [PATCH v2] f2fs: don't call f2fs_issue_discard_timeout() when discard_cmd_cnt is 0 in f2fs_put_super()

2022-12-10 Thread Chao Yu
On 2022/12/2 12:58, Yangtao Li wrote: No need to call f2fs_issue_discard_timeout() in f2fs_put_super, when no discard command requires issue. Since the caller of f2fs_issue_discard_timeout() usually judges the number of discard commands before using it. Let's move this logic to f2fs_issue_discard

Re: [f2fs-dev] [PATCH] f2fs: fix iostat parameter for discard

2022-12-10 Thread Chao Yu
On 2022/12/5 22:56, Yangtao Li wrote: Just like other data we count uses the number of bytes as the basic unit, but discard uses the number of cmds as the statistical unit. In fact the discard command contains the number of blocks, so let's change to the number of bytes as the base unit. Fixes:

Re: [f2fs-dev] [PATCH v2] f2fs: introduce f2fs_is_readonly() for readability

2022-12-10 Thread Chao Yu
On 2022/11/24 10:48, Yangtao Li wrote: Introduce f2fs_is_readonly() and use it to simplify code. 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: remove F2FS_SET_FEATURE() and F2FS_CLEAR_FEATURE() macro

2022-12-10 Thread Chao Yu
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: do some cleanup for f2fs module init

2022-12-10 Thread Chao Yu
On 2022/11/25 19:47, Yangtao Li wrote: Just for cleanup, no functional changes. Signed-off-by: Yangtao Li --- fs/f2fs/compress.c | 46 ++ fs/f2fs/data.c | 14 -- fs/f2fs/gc.c | 4 +--- fs/f2fs/recovery.c | 4 +--- fs/f2fs

Re: [f2fs-dev] [PATCH 1/6 v2] f2fs: specify extent cache for read explicitly

2022-12-10 Thread Chao Yu
On 2022/12/10 3:40, Jaegeuk Kim wrote: Let's descrbie it's read extent cache. Signed-off-by: Jaegeuk Kim Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge

Re: [f2fs-dev] [PATCH 1/6] f2fs: specify extent cache for read explicitly

2022-12-08 Thread Chao Yu
On 2022/12/9 1:29, Jaegeuk Kim wrote: On 12/08, Chao Yu wrote: On 2022/12/6 2:54, Jaegeuk Kim wrote: Let's descrbie it's read extent cache. Signed-off-by: Jaegeuk Kim --- fs/f2fs/extent_cache.c | 4 ++-- fs/f2fs/f2fs.h | 10 +- fs/f2fs/inode.c|

Re: [f2fs-dev] [PATCH 4/6 v2] f2fs: refactor extent_cache to support for read and more

2022-12-08 Thread Chao Yu
On 2022/12/7 3:05, Jaegeuk Kim wrote: This patch prepares extent_cache to get more use-cases. 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 3/6] f2fs: remove unnecessary __init_extent_tree

2022-12-08 Thread Chao Yu
On 2022/12/6 2:54, Jaegeuk Kim wrote: Added into the caller. 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

Re: [f2fs-dev] [PATCH 2/6] f2fs: move internal functions into extent_cache.c

2022-12-08 Thread Chao Yu
On 2022/12/6 2:54, Jaegeuk Kim wrote: No functional change. 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

Re: [f2fs-dev] [PATCH 1/6] f2fs: specify extent cache for read explicitly

2022-12-08 Thread Chao Yu
On 2022/12/6 2:54, Jaegeuk Kim wrote: Let's descrbie it's read extent cache. Signed-off-by: Jaegeuk Kim --- fs/f2fs/extent_cache.c | 4 ++-- fs/f2fs/f2fs.h | 10 +- fs/f2fs/inode.c| 2 +- fs/f2fs/node.c | 2 +- fs/f2fs/node.h | 2 +- fs/f2fs/se

Re: [f2fs-dev] [PATCH 3/3] f2fs: remove the unused flush argument to change_curseg

2022-12-08 Thread Chao Yu
On 2022/11/28 17:43, Christoph Hellwig wrote: Signed-off-by: Christoph Hellwig 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 2/3] f2fs: open code allocate_segment_by_default

2022-12-08 Thread Chao Yu
-by: Christoph Hellwig 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 1/3] f2fs: remove struct segment_allocation default_salloc_ops

2022-12-08 Thread Chao Yu
On 2022/11/28 17:43, Christoph Hellwig wrote: There is only single instance of these ops, so remove the indirection and call allocate_segment_by_default directly. Signed-off-by: Christoph Hellwig Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs

[f2fs-dev] [PATCH] MAINTAINERS: Add f2fs bug tracker link

2022-11-25 Thread Chao Yu
As f2fs component in bugzilla.kernel.org was created and used since 2018-7. Signed-off-by: Chao Yu --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index cf0f18502372..01fdbb592ea7 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -7828,6 +7828,7 @@ M

Re: [f2fs-dev] [PATCH v3] fsverity: stop using PG_error to track error status

2022-11-24 Thread Chao Yu
? Otherwise it looks good to me. 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 v3] fsverity: stop using PG_error to track error status

2022-11-24 Thread Chao Yu
On 2022/11/24 6:19, Eric Biggers wrote: On Thu, Nov 10, 2022 at 12:21:06AM -0800, Eric Biggers wrote: On Fri, Oct 28, 2022 at 10:58:07AM -0700, Eric Biggers wrote: From: Eric Biggers As a step towards freeing the PG_error flag for other uses, change ext4 and f2fs to stop using PG_error to tra

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

2022-11-24 Thread Chao Yu
Use f2fs_do_truncate_blocks() to truncate all blocks in-batch in __complete_revoke_list(). Signed-off-by: Chao Yu --- fs/f2fs/segment.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 14ece4bf7c7e..37c721e1eb03 100644

Re: [f2fs-dev] [PATCH v7] f2fs: introduce F2FS_IOC_START_ATOMIC_REPLACE

2022-11-24 Thread Chao Yu
On 2022/11/24 5:58, Jaegeuk Kim wrote: On 11/23, Chao Yu wrote: On 2022/11/12 1:04, Daeho Jeong wrote: From: Daeho Jeong introduce a new ioctl to replace the whole content of a file atomically, which means it induces truncate and content update at the same time. We can start it with

Re: [f2fs-dev] [PATCH] f2fs: set zstd compress level correctly

2022-11-24 Thread Chao Yu
On 2022/11/17 23:10, Sheng Yong wrote: Fixes: cf30f6a5f0c6 ("lib: zstd: Add kernel-specific API") Signed-off-by: Sheng Yong Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge

Re: [f2fs-dev] [RESEND][PATCH] f2fs: avoid victim selection from previous victim section

2022-11-24 Thread Chao Yu
: support subsectional garbage collection") Signed-off-by: Yonggil Song 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 v5] f2fs: fix to enable compress for newly created file if extension matches

2022-11-24 Thread Chao Yu
aegeuk 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 v2 2/2] f2fs: introduce discard_urgent_util sysfs node

2022-11-24 Thread Chao Yu
On 2022/11/24 0:44, Yangtao Li wrote: Through this node, you can control the background discard to run more aggressively or not aggressively when reach the utilization rate of the space. Signed-off-by: Yangtao Li Reviewed-by: Chao Yu Thanks

Re: [f2fs-dev] [PATCH v2 1/2] f2fs: define MIN_DISCARD_GRANULARITY macro

2022-11-24 Thread Chao Yu
On 2022/11/24 0:44, Yangtao Li wrote: Do cleanup in f2fs_tuning_parameters() and __init_discard_policy(), let's use macro instead of number. Suggested-by: Chao Yu Signed-off-by: Yangtao Li Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-

Re: [f2fs-dev] [PATCH] f2fs: init discard policy after thread wakeup

2022-11-24 Thread Chao Yu
meets expectations. 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 v4] f2fs: fix to enable compress for newly created file if extension matches

2022-11-23 Thread Chao Yu
On 2022/11/24 5:29, Jaegeuk Kim wrote: + if (S_ISDIR(inode->i_mode)) + goto inherit_comp; Documentation/filesystems/f2fs.rst - Priority in between FS_COMPR_FL, FS_NOCOMP_FS, extensions: * compress_extension=so; nocompress_extension=zip; chattr +c dir; touch dir/foo

Re: [f2fs-dev] [PATCH] f2fs: define DEFAULT_SMALL_VOLUME_DISCARD_GRANULARITY macro

2022-11-23 Thread Chao Yu
On 2022/11/19 2:02, Yangtao Li wrote: Do cleanup in f2fs_tuning_parameters(), let's use macro instead of number. Signed-off-by: Yangtao Li --- fs/f2fs/f2fs.h | 2 ++ fs/f2fs/super.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index

Re: [f2fs-dev] [PATCH] f2fs: fix description about discard_granularity node

2022-11-23 Thread Chao Yu
On 2022/11/19 1:40, Yangtao Li wrote: Let's fix the inconsistency in the text description. Default discard granularity is 16. For small devices, default value is 1. Signed-off-by: Yangtao Li Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-

Re: [f2fs-dev] [PATCH] f2fs: init discard policy after thread wakeup

2022-11-23 Thread Chao Yu
On 2022/11/18 11:46, Yangtao Li wrote: Under the current logic, after the discard thread wakes up, it will not run according to the expected policy, but will use the expected policy before sleep. Move the strategy selection to after the thread wakes up, so that the running state of the thread mee

Re: [f2fs-dev] [PATCH] f2fs: introduce discard_urgent_util sysfs node

2022-11-23 Thread Chao Yu
On 2022/11/17 22:35, Yangtao Li wrote: Through this node, you can control the background discard to run more aggressively when reach the utilization rate of the space. Signed-off-by: Yangtao Li --- Documentation/ABI/testing/sysfs-fs-f2fs | 8 fs/f2fs/f2fs.h

Re: [f2fs-dev] [PATCH] f2fs: make __queue_discard_cmd() return void

2022-11-23 Thread Chao Yu
On 2022/11/17 1:10, Yangtao Li wrote: Since __queue_discard_cmd() never returns an error, let's make it return void. Signed-off-by: Yangtao Li Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforg

Re: [f2fs-dev] [PATCH v7] f2fs: introduce F2FS_IOC_START_ATOMIC_REPLACE

2022-11-23 Thread Chao Yu
On 2022/11/12 1:04, Daeho Jeong wrote: From: Daeho Jeong introduce a new ioctl to replace the whole content of a file atomically, which means it induces truncate and content update at the same time. We can start it with F2FS_IOC_START_ATOMIC_REPLACE and complete it with F2FS_IOC_COMMIT_ATOMIC_W

Re: [f2fs-dev] [PATCH] f2fs: remove useless io_aware_gran variable

2022-11-23 Thread Chao Yu
On 2022/11/16 21:10, Yuwei Guan wrote: This 'io_aware_gran' is initialized as MAX_PLIST_NUM in __init_discard_policy(), and use as 'i < dpolicy->io_aware_gran' in __issue_discard_cmd(), but 'i < dpolicy->io_aware_gran' is true always, so remvoe this variable. I guess we can export it via sysfs

Re: [f2fs-dev] [PATCH] f2fs: fix to set DISCARD opt

2022-11-23 Thread Chao Yu
On 2022/11/16 2:40, Yangtao Li wrote: Some minor modifications to discard opt and related parameters: 1.introduce f2fs_is_readonly() and use it to simplify code 2.The FLUSH_MERGE opt is set by default only in non-ro mode. 3.When ro and DISCARD are set at the same time, an error is repor

Re: [f2fs-dev] [PATCH v4] f2fs: fix to enable compress for newly created file if extension matches

2022-11-23 Thread Chao Yu
On 2022/11/17 9:12, Jaegeuk Kim wrote: If compress_extension is set, and a newly created file matches the extension, the file could be marked as compression file. However, if inline_data is also enabled, there is no chance to check its extension since f2fs_should_compress() always returns false.

Re: [f2fs-dev] [PATCH v1] f2fs: avoid victim selection from previous victim section

2022-11-22 Thread Chao Yu
Hi Yonggil, I guess your email client forces converting tab and space characters of patch, please check that. On 2022/11/22 10:36, Yonggil Song wrote: When f2fs chooses GC victim in large section & LFS mode, next_victim_seg[gc_type] is referenced first. After segment is freed, next_victim_seg[g

Re: [f2fs-dev] [PATCH v2 3/3] f2fs: change type for 'sbi->readdir_ra'

2022-11-15 Thread Chao Yu
On 2022/11/15 14:35, Yuwei Guan wrote: Before this patch, the varibale 'readdir_ra' takes effect if it's equal to '1' or not, so we can change type for it from 'int' to 'bool'. Signed-off-by: Yuwei Guan Reviewed-by: Chao Yu Thanks,

Re: [f2fs-dev] [PATCH v2 2/3] f2fs: cleanup for 'f2fs_tuning_parameters' function

2022-11-15 Thread Chao Yu
On 2022/11/15 14:35, Yuwei Guan wrote: A cleanup patch for 'f2fs_tuning_parameters' function. Signed-off-by: Yuwei Guan Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge

Re: [f2fs-dev] [PATCH v2 1/3] f2fs: fix to alloc_mode changed after remount on a small volume device

2022-11-15 Thread Chao Yu
o remount on this small size dievce. This patch fo fix alloc_mode changed when do remount for a small volume device. Signed-off-by: Yuwei Guan Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net

Re: [f2fs-dev] [PATCH] f2fs: Fix error log cluster size warning in sanity_check_inode()

2022-11-15 Thread Chao Yu
On 2022/11/15 16:46, Zhang Qilong wrote: Mounting f2fs with following issue: sanity_check_inode: inode (ino=4827) has unsupported log cluster size: 0, run fsck to fix ->find_fsync_dnodes ->add_fsync_inode ->f2fs_iget_retry ->f2fs_iget ->do_read_inode ->sanity_check_inode It

Re: [f2fs-dev] [PATCH v2 1/2] f2fs: fix to enable compress for newly created file if extension matches

2022-11-14 Thread Chao Yu
On 2022/11/15 8:20, Jaegeuk Kim wrote: On 11/14, Jaegeuk Kim wrote: If compress_extension is set, and a newly created file matches the extension, the file could be marked as compression file. However, if inline_data is also enabled, there is no chance to check its extension since f2fs_should_com

Re: [f2fs-dev] [PATCH] f2fs: remove submit label in __submit_discard_cmd()

2022-11-14 Thread Chao Yu
SECTOR_FROM_BLOCK(len), GFP_NOFS, &bio); Thanks. I added {} to meet the coding style. Reviewed-by: Chao Yu Thanks, -submit: if (err) { spin_lock_irqsave(&dc->lock, flags);

Re: [f2fs-dev] [PATCH v2 1/2] f2fs: fix to enable compress for newly created file if extension matches

2022-11-14 Thread Chao Yu
On 2022/11/15 6:39, Jaegeuk Kim wrote: If compress_extension is set, and a newly created file matches the extension, the file could be marked as compression file. However, if inline_data is also enabled, there is no chance to check its extension since f2fs_should_compress() always returns false.

Re: [f2fs-dev] [PATCH 1/3] f2fs: fix to alloc_mode changed after remount on a small volume device

2022-11-14 Thread Chao Yu
On 2022/11/15 0:13, Yuwei Guan wrote: On 2022/11/14 22:42, Chao Yu wrote: On 2022/11/12 16:32, Yuwei Guan wrote: The commit 84b89e5d943d8 ("f2fs: add auto tuning for small devices") add tuning for small volume device, now support to tune alloce_mode to 'reuse' if it&#

[f2fs-dev] [PATCH] f2fs: fix to do sanity check on i_extra_isize in is_alive()

2022-11-14 Thread Chao Yu
invalid address later, fix it. - gc_data_segment - is_alive - data_blkaddr - offset_in_addr Reported-by: syzbot+f8f3dfa4abc489e76...@syzkaller.appspotmail.com Link: https://lore.kernel.org/linux-f2fs-devel/3cb3c405ed5c1...@google.com/T/#u Signed-off-by: Chao Yu --- fs/f2fs/gc.c

Re: [f2fs-dev] [PATCH v2 1/2] f2fs: fix to enable compress for newly created file if extension matches

2022-11-14 Thread Chao Yu
On 2022/11/12 9:27, Jaegeuk Kim wrote: Does thes make sense? Jaegeuk, Could you please send modified patches to mailing list, otherwise, I can not add comments on specified line. Thanks, https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git/commit/?h=dev-test&id=608460dfae20b9d2

Re: [f2fs-dev] [BUG REPORT] f2fs: use-after-free during garbage collection

2022-11-14 Thread Chao Yu
On 2022/11/14 9:47, Jun Nie wrote: Hi Chao & Jaegeuk, There is a KASAN report[0] that shows invalid memory access(use-after-free) in f2fs garbage collection process, and this issue is fixed by a recent f2fs patch set[1]. The KASAN report is caused by an abnormal sum->ofs_in_node value 0xc3f1 in

[f2fs-dev] [PATCH] f2fs: fix to do sanity check on i_extra_isize in is_alive()

2022-11-14 Thread Chao Yu
invalid address later, fix it. - gc_data_segment - is_alive - data_blkaddr - offset_in_addr Reported-by: syzbot+f8f3dfa4abc489e76...@syzkaller.appspotmail.com Link: https://lore.kernel.org/linux-f2fs-devel/3cb3c405ed5c1...@google.com/T/#u Signed-off-by: Chao Yu --- fs/f2fs/gc.c

Re: [f2fs-dev] [PATCH 3/3] f2fs: change type for 'sbi->readdir_ra'

2022-11-14 Thread Chao Yu
On 2022/11/12 16:32, Yuwei Guan wrote: Before this patch, the varibale 'readdir_ra' takes effect if it's equal to '1' or not, so we can change type for it from 'int' to 'bool'. Signed-off-by: Yuwei Guan --- fs/f2fs/dir.c | 7 +++ fs/f2fs/f2fs.h | 2 +- fs/f2fs/super.c | 2 +- fs/f2f

Re: [f2fs-dev] [PATCH v2] fsck.f2fs: avoid uncessary recalculation

2022-11-14 Thread Chao Yu
On 2022/11/14 22:17, Sheng Yong wrote: There is no need to recalculate ADDRS_PER_INODE and ADDRS_PER_BLOCK, especially in a for loop. Signed-off-by: Sheng Yong Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel

Re: [f2fs-dev] [PATCH 1/3] f2fs: fix to alloc_mode changed after remount on a small volume device

2022-11-14 Thread Chao Yu
On 2022/11/12 16:32, Yuwei Guan wrote: The commit 84b89e5d943d8 ("f2fs: add auto tuning for small devices") add tuning for small volume device, now support to tune alloce_mode to 'reuse' if it's small size. But the alloc_mode will change to 'default' when do remount on this small size dievce. Th

Re: [f2fs-dev] [PATCH 4/4] fsck.f2fs: avoid uncessary recalculation

2022-11-13 Thread Chao Yu
On 2022/11/10 22:07, Sheng Yong wrote: There is no need to recalculate ADDRS_PER_INODE and ADDRS_PER_BLOCK, especially in a for loop. Signed-off-by: Sheng Yong --- fsck/fsck.c | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/fsck/fsck.c b/fsck/fsck.c i

Re: [f2fs-dev] [PATCH 3/4] fsck.f2fs: fix potential overflow of copying i_name

2022-11-13 Thread Chao Yu
On 2022/11/10 22:07, Sheng Yong wrote: If i_namelen is corrupted, there may be an overflow when doing memcpy. Signed-off-by: Sheng Yong Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https

Re: [f2fs-dev] [PATCH 2/4] fsck.f2fs: add parentheses for SB_MASK

2022-11-13 Thread Chao Yu
On 2022/11/10 22:07, Sheng Yong wrote: Signed-off-by: Sheng Yong 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 1/4] dump.f2fs: remove unavailable optiont -g

2022-11-13 Thread Chao Yu
On 2022/11/10 22:07, Sheng Yong wrote: Option "-g" for dump.f2fs is unavailable and not used in dump.f2fs. Signed-off-by: Sheng Yong Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge

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

2022-11-13 Thread Chao Yu
On 2022/10/18 4:24, Vishal Moola (Oracle) wrote: Converted the function to use a folio_batch instead of pagevec. This is in preparation for the removal of find_get_pages_range_tag(). Also modified f2fs_all_cluster_page_ready to take in a folio_batch instead of pagevec. This does NOT support larg

Re: [f2fs-dev] [PATCH v6] f2fs: support errors=remount-ro|continue|panic mountoption

2022-11-13 Thread Chao Yu
On 2022/11/8 9:17, Chao Yu wrote: Jaegeuk, On 2022/11/8 5:49, Jaegeuk Kim wrote: Chao, Could you please run xfstests since I met some issues with this? I had to drop this to test other patches. Oops, I ran xfstests on v5, I didn't see any issus... and in v6 I just rebase codes on (

Re: [f2fs-dev] [PATCH v2 1/2] f2fs: fix to enable compress for newly created file if extension matches

2022-11-11 Thread Chao Yu
. This patch moves set_compress_inode(), which do extension check, in f2fs_should_compress() to check extensions before setting inline data flag. Fixes: 7165841d578e ("f2fs: fix to check inline_data during compressed inode conversion") Signed-off-by: Sheng Yong Reviewed-by: Chao Y

<    8   9   10   11   12   13   14   15   >