Re: [f2fs-dev] [PATCH] f2fs: compress: don't redirty sparse cluster during {, de}compress

2024-08-15 Thread Chao Yu
On 2024/8/13 14:11, Yeongjin Gil wrote: In f2fs_do_write_data_page, when the data block is NULL_ADDR, it skips writepage considering that it has been already truncated. This results in an infinite loop as the PAGECACHE_TAG_TOWRITE tag is not cleared during the writeback process for a compressed f

Re: [f2fs-dev] [PATCH] f2fs-tools: add write hint support

2024-08-14 Thread Chao Yu
On 2024/8/9 15:32, Daejun Park wrote: This patch enables support for write hints by segment type. What about adding an option to enable this functionality? otherwise, for a device which doesn't support whint feature, it will cause overhead whenever calling fcntl() syscall. [snip] @@ -1005,7

Re: [f2fs-dev] [PATCH] fsck.f2fs: don't finish zones if it's not open

2024-08-14 Thread Chao Yu
On 2024/8/9 4:57, Jaegeuk Kim wrote: Should finish zones if they are open. 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

Re: [f2fs-dev] [PATCH] f2fs: fix unreleased reader lock on return

2024-08-14 Thread Chao Yu
On 2024/8/15 5:16, Diogo Jahchan Koike wrote: fix reader lock unreleased in error path. Thank you for catching this, if you don't mind, I'd like to merge it to original patch, since it is still in dev-test branch. Thanks, Fixes: 374a8881ce4c ("f2fs: atomic: fix to forbid dio in atomic_file"

Re: [f2fs-dev] [PATCH] f2fs: Use sysfs_emit_at() to simplify code

2024-08-14 Thread Chao Yu
On 2024/8/15 0:11, Jaegeuk Kim wrote: Sorry, could you please post the patch to the mailing list again? I don't see the first patch. I've resent it. :) Thanks, Thanks, On 08/14, Chao Yu wrote: On 2024/8/8 19:50, Christophe JAILLET wrote: This file already uses sysfs_emi

[f2fs-dev] [PATCH RESEND] f2fs: Use sysfs_emit_at() to simplify code

2024-08-14 Thread Chao Yu
From: Christophe JAILLET This file already uses sysfs_emit(). So be consistent and also use sysfs_emit_at(). This slightly simplifies the code and makes it more readable. Reviewed-by: Chao Yu Signed-off-by: Christophe JAILLET --- fs/f2fs/sysfs.c | 45

[f2fs-dev] [PATCH v2 8/9] f2fs: convert f2fs_read_multi_pages() to use folio

2024-08-14 Thread Chao Yu
Convert to use folio, so that we can get rid of 'page->index' to prepare for removal of 'index' field in structure page [1]. [1] https://lore.kernel.org/all/zp8fgusibgq1t...@casper.infradead.org/ Cc: Matthew Wilcox Signed-off-by: Chao Yu --- v2: - check return

[f2fs-dev] [PATCH v2 2/4] f2fs: atomic: fix to not allow GC to pollute atomic_file

2024-08-14 Thread Chao Yu
iteback_range() to wait completion of block migration. Fixes: 3db1de0e582c ("f2fs: change the current atomic write way") Signed-off-by: Chao Yu --- v2: - fix error path handling. fs/f2fs/segment.c | 27 +++ 1 file changed, 23 insertions(+), 4 deletions(-) diff --gi

Re: [f2fs-dev] [PATCH] fsck.f2fs: don't call dev_fill w/ null buffer

2024-08-14 Thread Chao Yu
On 2024/8/9 7:32, Jaegeuk Kim wrote: It'll crach fsck.f2fs. Even, let's keep the write pointers and just finish it. Signed-off-by: Jaegeuk Kim Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourc

Re: [f2fs-dev] [PATCH] f2fs: Use sysfs_emit_at() to simplify code

2024-08-14 Thread Chao Yu
On 2024/8/8 19:50, Christophe JAILLET wrote: This file already uses sysfs_emit(). So be consistent and also use sysfs_emit_at(). This slightly simplifies the code and makes it more readable. Signed-off-by: Christophe JAILLET Reviewed-by: Chao Yu Thanks

Re: [f2fs-dev] [PATCH] f2fs: avoid unused block when dio write in LFS mode

2024-08-14 Thread Chao Yu
On 2024/8/1 15:47, Daejun Park wrote: This patch addresses the problem that when using LFS mode, unused blocks may occur in f2fs_map_blocks() during block allocation for dio writes. If a new section is allocated during block allocation, it will not be included in the map struct by map_is_mergeab

Re: [f2fs-dev] [PATCH] f2fs: Create COW inode from parent dentry for atomic write

2024-08-13 Thread Chao Yu
. To resolve this issue, let's get parent inode using parent dentry directly. Fixes: 3db1de0e582c ("f2fs: change the current atomic write way") Reviewed-by: Sungjong Seo Reviewed-by: Sunmin Jeong Signed-off-by: Yeongjin Gil Reviewed-

Re: [f2fs-dev] [syzbot] [f2fs?] WARNING: lock held when returning to user space in f2fs_commit_atomic_write

2024-08-13 Thread Chao Yu
On 2024/8/14 8:48, Edward Adam Davis wrote: unlock i_gc_rwsem[WRITE] before quiting f2fs_commit_atomic_write Fixes: 7566a155c666 ("f2fs: atomic: fix to not allow GC to pollute atomic_file") Since original patch has not been merged, if you don't mind, I'd like to fix this issue in original patc

Re: [f2fs-dev] [PATCH 1/9] f2fs: convert f2fs_compress_ctx_add_page() to use folio

2024-08-13 Thread Chao Yu
) < blocksize) + if (!bio_add_folio(bio, folio, blocksize, 0)) goto submit_and_realloc; ctx = get_post_read_ctx(bio); -- 2.40.1 After applying this, it doesn't complain now. Thanks, On 08/13, Chao Yu wrote: onvert to use folio, so tha

Re: [f2fs-dev] [PATCH 1/9] f2fs: convert f2fs_compress_ctx_add_page() to use folio

2024-08-13 Thread Chao Yu
soon. Thanks, in f2fs_put_dic, when running fsstress. You can reproduce it quickly. On 08/13, Chao Yu wrote: onvert to use folio, so that we can get rid of 'page->index' to prepare for removal of 'index' field in structure page [1]. [1] https://lore.

[f2fs-dev] [PATCH 7/9] f2fs: convert __f2fs_write_meta_page() to use folio

2024-08-13 Thread Chao Yu
Convert to use folio, so that we can get rid of 'page->index' to prepare for removal of 'index' field in structure page [1]. [1] https://lore.kernel.org/all/zp8fgusibgq1t...@casper.infradead.org/ Cc: Matthew Wilcox Signed-off-by: Chao Yu --- fs/f2fs/checkpoint.c | 1

[f2fs-dev] [PATCH 3/9] f2fs: convert f2fs_clear_page_cache_dirty_tag() to use folio

2024-08-13 Thread Chao Yu
Convert to use folio, so that we can get rid of 'page->index' to prepare for removal of 'index' field in structure page [1]. [1] https://lore.kernel.org/all/zp8fgusibgq1t...@casper.infradead.org/ Cc: Matthew Wilcox Signed-off-by: Chao Yu --- fs/f2fs/data.c | 3 +-

[f2fs-dev] [PATCH 2/9] f2fs: convert f2fs_vm_page_mkwrite() to use folio

2024-08-13 Thread Chao Yu
Convert to use folio, so that we can get rid of 'page->index' to prepare for removal of 'index' field in structure page [1]. [1] https://lore.kernel.org/all/zp8fgusibgq1t...@casper.infradead.org/ Cc: Matthew Wilcox Signed-off-by: Chao Yu -

[f2fs-dev] [PATCH 5/9] f2fs: convert f2fs_write_single_data_page() to use folio

2024-08-13 Thread Chao Yu
Convert to use folio, so that we can get rid of 'page->index' to prepare for removal of 'index' field in structure page [1]. [1] https://lore.kernel.org/all/zp8fgusibgq1t...@casper.infradead.org/ Cc: Matthew Wilcox Signed-off-by: Chao Yu --- fs/f2fs/compress.c |

[f2fs-dev] [PATCH 9/9] f2fs: convert f2fs_handle_page_eio() to use folio

2024-08-13 Thread Chao Yu
Convert to use folio, so that we can get rid of 'page->index' to prepare for removal of 'index' field in structure page [1]. [1] https://lore.kernel.org/all/zp8fgusibgq1t...@casper.infradead.org/ Cc: Matthew Wilcox Signed-off-by: Chao Yu --- fs/f2fs/checkpoint.c

[f2fs-dev] [PATCH 6/9] f2fs: convert f2fs_do_write_meta_page() to use folio

2024-08-13 Thread Chao Yu
Convert to use folio, so that we can get rid of 'page->index' to prepare for removal of 'index' field in structure page [1]. [1] https://lore.kernel.org/all/zp8fgusibgq1t...@casper.infradead.org/ Cc: Matthew Wilcox Signed-off-by: Chao Yu --- fs/f2fs/checkpoint.c

[f2fs-dev] [PATCH 4/9] f2fs: convert f2fs_write_inline_data() to use folio

2024-08-13 Thread Chao Yu
Convert to use folio, so that we can get rid of 'page->index' to prepare for removal of 'index' field in structure page [1]. [1] https://lore.kernel.org/all/zp8fgusibgq1t...@casper.infradead.org/ Cc: Matthew Wilcox Signed-off-by: Chao Yu --- fs/f2fs/data.c | 2 +-

[f2fs-dev] [PATCH 1/9] f2fs: convert f2fs_compress_ctx_add_page() to use folio

2024-08-13 Thread Chao Yu
onvert to use folio, so that we can get rid of 'page->index' to prepare for removal of 'index' field in structure page [1]. [1] https://lore.kernel.org/all/zp8fgusibgq1t...@casper.infradead.org/ Cc: Matthew Wilcox Signed-off-by: Chao Yu --- fs/f2fs/compress.c | 14

[f2fs-dev] [PATCH 8/9] f2fs: convert f2fs_read_multi_pages() to use folio

2024-08-13 Thread Chao Yu
Convert to use folio, so that we can get rid of 'page->index' to prepare for removal of 'index' field in structure page [1]. [1] https://lore.kernel.org/all/zp8fgusibgq1t...@casper.infradead.org/ Cc: Matthew Wilcox Signed-off-by: Chao Yu --- fs/f2fs/data.c | 28

Re: [f2fs-dev] [PATCH] f2fs-tools: reduce overprov_segment_count set times

2024-08-12 Thread Chao Yu
On 2024/8/1 17:18, zhangxirui wrote: If overprov_segment_count < rsvd_segment_count will set_cp(overprov_segment_count) twice, reduce it. Signed-off-by: zhangxirui Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-de

Re: [f2fs-dev] [PATCH] f2fs: file: add checks to f2fs_ioc_flush_device()

2024-08-12 Thread Chao Yu
On 2024/8/1 15:17, Roman Smirnov wrote: If invalid data is copied from user space and if GET_SEGNO() returns NULL_SEGNO an overflow is possible. Can you explain in which condition that FDEV(range.dev_num).start_blk or FDEV(range.dev_num).end_blk will be invalid? > > Add checks for invalid valu

[f2fs-dev] [PATCH] f2fs: fix to wait page writeback before setting gcing flag

2024-08-12 Thread Chao Yu
fs: fix to tag gcing flag on page during file defragment") Fixes: 4961acdd65c9 ("f2fs: fix to tag gcing flag on page during block migration") Signed-off-by: Chao Yu --- fs/f2fs/file.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index e

Re: [f2fs-dev] [PATCH] f2fs: Require FMODE_WRITE for atomic write ioctls

2024-08-07 Thread Chao Yu
ate caller should only be using these ioctls when intending to write into the file, that seems unlikely to break anything. Fixes: 88b88a667971 ("f2fs: support atomic writes") Cc: sta...@vger.kernel.org Signed-off-by: Jann Horn Reviewed-

[f2fs-dev] [PATCH v4 3/4] f2fs: atomic: fix to truncate pagecache before on-disk metadata truncation

2024-08-07 Thread Chao Yu
We should always truncate pagecache while truncating on-disk data. Fixes: a46bebd502fe ("f2fs: synchronize atomic write aborts") Signed-off-by: Chao Yu --- v4: - don't reset i_size to zero. fs/f2fs/file.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/f2fs/file.c b

Re: [f2fs-dev] [PATCH] f2fs: clean up val{>>,<<}F2FS_BLKSIZE_BITS

2024-08-02 Thread Chao Yu
On 2024/8/1 9:33, Zhiguo Niu wrote: Use F2FS_BYTES_TO_BLK(bytes) and F2FS_BLK_TO_BYTES(blk) for cleanup Signed-off-by: Zhiguo Niu Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https

[f2fs-dev] [PATCH v3 3/4] f2fs: atomic: fix to truncate pagecache before on-disk metadata truncation

2024-07-31 Thread Chao Yu
We should always truncate pagecache while truncating on-disk data. Fixes: a46bebd502fe ("f2fs: synchronize atomic write aborts") Signed-off-by: Chao Yu --- v3: - check dirty page before truncation - use invalidate_mapping_pages() instead of truncate_inode_pages() - set i_size to

Re: [f2fs-dev] [PATCH v2 3/4] f2fs: atomic: fix to truncate pagecache before on-disk metadata truncation

2024-07-31 Thread Chao Yu
On 2024/7/31 0:26, Jaegeuk Kim wrote: On 07/30, Chao Yu wrote: On 2024/7/30 0:26, Jaegeuk Kim wrote: On 07/26, Chao Yu wrote: We should always truncate pagecache while truncating on-disk data. Fixes: a46bebd502fe ("f2fs: synchronize atomic write aborts") Signed-off-by: Chao Yu ---

Re: [f2fs-dev] [PATCH v2] inject.f2fs: fix some build errors

2024-07-31 Thread Chao Yu
On 2024/7/31 3:36, 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 v2 3/4] f2fs: atomic: fix to truncate pagecache before on-disk metadata truncation

2024-07-29 Thread Chao Yu
On 2024/7/30 0:26, Jaegeuk Kim wrote: On 07/26, Chao Yu wrote: We should always truncate pagecache while truncating on-disk data. Fixes: a46bebd502fe ("f2fs: synchronize atomic write aborts") Signed-off-by: Chao Yu --- v2: - fix to use cow_inode instead of inode fs/f2fs/file.c

[f2fs-dev] [PATCH v2] f2fs: fix to avoid use-after-free in f2fs_stop_gc_thread()

2024-07-29 Thread Chao Yu
bbed sb->s_umount semaphore. Reported-by: syzbot+1a8e2b31f2ac9bd3d...@syzkaller.appspotmail.com Closes: https://lore.kernel.org/linux-f2fs-devel/5c7ccb061e032...@google.com Fixes: 7950e9ac638e ("f2fs: stop gc/discard thread after fs shutdown") Signed-off-by: Chao Yu Signed-off-

Re: [f2fs-dev] [PATCH] f2fs: sysfs: support atgc_enabled

2024-07-28 Thread Chao Yu
On 2024/7/27 11:25, Jaegeuk Kim wrote: On 07/26, Chao Yu wrote: On 2024/2/21 15:32, liujinbao1 wrote: From: liujinbao1 When we add "atgc" to the fstab table, ATGC is not immediately enabled. There is a 7-day time threshold, and we can use "atgc_enabled" to show whether A

Re: [f2fs-dev] [PATCH] f2fs: don't traverse directory blocks after EOF

2024-07-28 Thread Chao Yu
On 2024/7/27 11:27, Jaegeuk Kim wrote: On 07/26, Chao Yu wrote: On 2024/7/26 0:55, Jaegeuk Kim wrote: On 07/12, Chao Yu wrote: All directory blocks are within the scope of i_size, so let's limit the end_block to just check valid dirent blocks. Do we really need this? f2fs_readdir(

Re: [f2fs-dev] [PATCH] f2fs: fix to avoid use-after-free in f2fs_stop_gc_thread()

2024-07-28 Thread Chao Yu
On 2024/7/27 23:27, Jaegeuk Kim wrote: On 07/27, Jaegeuk Kim wrote: On 07/25, Chao Yu wrote: syzbot reports a f2fs bug as below: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 print_report+0xe8/0x550 mm/kasan/report.c:491 kasan_report+0x143

Re: [f2fs-dev] [PATCH v2] f2fs: test for race condition in between atomic_write and gc

2024-07-28 Thread Chao Yu
On 2024/7/26 23:49, Zorro Lang wrote: On Sat, Jul 20, 2024 at 03:43:16PM +0800, Chao Yu wrote: Test that we will simulate sqlite atomic write logic w/ below steps: 1. create a regular file, and initialize it w/ 0xff data 2. start transaction (via F2FS_IOC_START_ATOMIC_WRITE) on it 3. write

Re: [f2fs-dev] [PATCH V2] f2fs: fix to use per-inode maxbytes and cleanup

2024-07-26 Thread Chao Yu
On 2024/7/26 14:27, Zhiguo Niu wrote: This is a supplement to commit 6d1451bf7f84 ("f2fs: fix to use per-inode maxbytes") for some missed cases, also cleanup redundant code in f2fs_llseek. Cc: Chengguang Xu Signed-off-by: Zhiguo Niu Reviewed-by: Chao Y

Re: [f2fs-dev] [PATCH v2] dump.f2fs: add checkpoint version to dump_nat

2024-07-26 Thread Chao Yu
On 2024/7/26 10:25, Wu Bo wrote: The cp_ver of node footer is useful when analyzing data corruption issues. Signed-off-by: Wu Bo Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https

[f2fs-dev] [PATCH v2 3/4] f2fs: atomic: fix to truncate pagecache before on-disk metadata truncation

2024-07-25 Thread Chao Yu
We should always truncate pagecache while truncating on-disk data. Fixes: a46bebd502fe ("f2fs: synchronize atomic write aborts") Signed-off-by: Chao Yu --- v2: - fix to use cow_inode instead of inode fs/f2fs/file.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/f2fs/file.c

Re: [f2fs-dev] [PATCH] f2fs: sysfs: support atgc_enabled

2024-07-25 Thread Chao Yu
On 2024/2/21 15:32, liujinbao1 wrote: From: liujinbao1 When we add "atgc" to the fstab table, ATGC is not immediately enabled. There is a 7-day time threshold, and we can use "atgc_enabled" to show whether ATGC is enabled. Oh, I missed to reply on this patch, what about adding this readonly a

Re: [f2fs-dev] [PATCH] Revert "f2fs: use flush command instead of FUA for zoned device"

2024-07-25 Thread Chao Yu
nce Commit dd291d77cc90eb6a86e9860ba8e6e38eebd57d12 ("block: Introduce zone write plugging") has enabled the block layer to handle this order issue, there is no need to use flush command. Signed-off-by: Wenjie Cheng Reviewed-by: Chao Yu Thanks, ___ Linux-f2f

Re: [f2fs-dev] [PATCH v2 2/2] f2fs: fix macro definition stat_inc_cp_count

2024-07-25 Thread Chao Yu
On 2024/7/22 10:39, Julian Sun wrote: The macro stat_inc_cp_count accepts a parameter si, but it was not used, rather the variable sbi was directly used, which may be a local variable inside a function that calls the macros. Signed-off-by: Julian Sun Reviewed-by: Chao Yu Thanks

Re: [f2fs-dev] [PATCH v2 1/2] f2fs: fix macro definition on_f2fs_build_free_nids

2024-07-25 Thread Chao Yu
On 2024/7/22 10:39, Julian Sun wrote: The macro on_f2fs_build_free_nids accepts a parameter nmi, but it was not used, rather the variable nm_i was directly used, which may be a local variable inside a function that calls the macros. Signed-off-by: Julian Sun Reviewed-by: Chao Yu Thanks

Re: [f2fs-dev] [PATCH 3/4] f2fs: atomic: fix to truncate pagecache before on-disk metadata truncation

2024-07-25 Thread Chao Yu
On 2024/7/26 4:54, Jaegeuk Kim wrote: On 06/25, Chao Yu wrote: We should always truncate pagecache while truncating on-disk data. Fixes: a46bebd502fe ("f2fs: synchronize atomic write aborts") Signed-off-by: Chao Yu --- fs/f2fs/file.c | 1 + 1 file changed, 1 insertion(+) diff

Re: [f2fs-dev] [PATCH] f2fs: don't traverse directory blocks after EOF

2024-07-25 Thread Chao Yu
On 2024/7/26 0:55, Jaegeuk Kim wrote: On 07/12, Chao Yu wrote: All directory blocks are within the scope of i_size, so let's limit the end_block to just check valid dirent blocks. Do we really need this? f2fs_readdir() and f2fs_empty_dir() uses dir_blocks() for upper boundary, this

Re: [f2fs-dev] [PATCH] dump.f2fs: add checkpoint version to dump_nat

2024-07-25 Thread Chao Yu
On 2024/7/25 11:51, Wu Bo wrote: On Thu, Jul 25, 2024 at 10:33:33AM +0800, Chao Yu wrote: On 2024/7/24 18:35, Wu Bo wrote: The cp_ver of node footer is useful when analyzing data corruption issues. Signed-off-by: Wu Bo --- fsck/dump.c | 33 ++--- 1 file

Re: [f2fs-dev] [PATCH] f2fs: avoid potential int overflow in sanity_check_area_boundary()

2024-07-24 Thread Chao Yu
Verification Center (linuxtesting.org) with static analysis tool SVACE. Fixes: fd694733d523 ("f2fs: cover large section in sanity check of super") Cc: sta...@vger.kernel.org Signed-off-by: Nikita Zhandarovich Reviewed-by: Chao Yu Thanks, ___ Linux-

Re: [f2fs-dev] [PATCH] f2fs: fix several potential integer overflows in file offsets

2024-07-24 Thread Chao Yu
one of the addends to (pgoff_t) type. Found by Linux Verification Center (linuxtesting.org) with static analysis tool SVACE. Fixes: d323d005ac4a ("f2fs: support file defragment") Cc: sta...@vger.kernel.org Signed-off-by: Nikita Zhandarovich Reviewed-by: Chao Y

Re: [f2fs-dev] [PATCH] f2fs: prevent possible int overflow in dir_block_index()

2024-07-24 Thread Chao Yu
mul_u32_u32() as it's more appropriate to mitigate the issue. Found by Linux Verification Center (linuxtesting.org) with static analysis tool SVACE. Fixes: 3843154598a0 ("f2fs: introduce large directory support") Cc: sta...@vger.kernel.org Signed-off-by: Nikita Zhandarovich Revie

Re: [f2fs-dev] [PATCH] dump.f2fs: add checkpoint version to dump_nat

2024-07-24 Thread Chao Yu
On 2024/7/24 18:35, Wu Bo wrote: The cp_ver of node footer is useful when analyzing data corruption issues. Signed-off-by: Wu Bo --- fsck/dump.c | 33 ++--- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/fsck/dump.c b/fsck/dump.c index 8d5613e..ca

Re: [f2fs-dev] [PATCH] libf2fs: add BLKFINISHZONE define if not defined

2024-07-24 Thread Chao Yu
On 2024/7/24 18:28, Wu Bo wrote: BLKFINISHZONE may not defined in old blkzoned.h, and cause build error. Signed-off-by: Wu Bo Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https

Re: [f2fs-dev] [PATCH v3] dump.f2fs: Dump symlinks as symlinks

2024-07-24 Thread Chao Yu
when available. Currently hardlinks aren't detected, so print a warning if we notice a nondirectory with a link count over 1. Signed-off-by: Daniel Rosenberg Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-

[f2fs-dev] [PATCH] f2fs: fix to avoid use-after-free in f2fs_stop_gc_thread()

2024-07-24 Thread Chao Yu
ported-by: syzbot+1a8e2b31f2ac9bd3d...@syzkaller.appspotmail.com Closes: https://lore.kernel.org/linux-f2fs-devel/5c7ccb061e032...@google.com Fixes: 7950e9ac638e ("f2fs: stop gc/discard thread after fs shutdown") Signed-off-by: Chao Yu --- fs/f2fs/file.c | 3 +++ 1 file cha

Re: [f2fs-dev] [PATCH] dump.f2fs: Dump symlinks as symlinks

2024-07-23 Thread Chao Yu
On 2024/7/16 9:57, Daniel Rosenberg wrote: Previously, dumped symlinks would always create regular files instead. This allows symlinks to be dumped as symlinks with the -L option. The i_name field's name may not be the same as the actual name from the dirent, so we use the dirent name when avail

Re: [f2fs-dev] [PATCH] f2fs: fix to use per-inode maxbytes and cleanup

2024-07-21 Thread Chao Yu
On 2024/7/18 17:36, Zhiguo Niu wrote: This is a supplement to commit 6d1451bf7f84 ("f2fs: fix to use per-inode maxbytes") for some missed cases, also cleanup redundant code in f2fs_llseek. Cc: Chengguang Xu Signed-off-by: Zhiguo Niu Reviewed-by: Chao Y

Re: [f2fs-dev] [PATCH 2/2] f2fs: fix macro definition stat_inc_cp_count

2024-07-21 Thread Chao Yu
On 2024/7/21 21:17, Julian Sun wrote: The macro stat_inc_cp_count accepts a parameter si, but it was not used, rather the variable sbi was directly used, which may be a local variable inside a function that calls the macros. Signed-off-by: Julian Sun --- fs/f2fs/f2fs.h | 2 +- 1 file changed

Re: [f2fs-dev] [PATCH 1/2] f2fs: fix macro definition on_f2fs_build_free_nids

2024-07-21 Thread Chao Yu
On 2024/7/21 21:17, Julian Sun wrote: The macro on_f2fs_build_free_nids accepts a parameter nmi, but it was not used, rather the variable nm_i was directly used, which may be a local variable inside a function that calls the macros. Signed-off-by: Julian Sun --- fs/f2fs/node.c | 2 +- 1 file

Re: [f2fs-dev] [PATCH v5] f2fs:Add write priority option based on zone UFS

2024-07-21 Thread Chao Yu
:Traditional UFS priority mode, prioritize writing to traditional UFS. Signed-off-by: Liao Yuanhong Signed-off-by: Wu Bo Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https

Re: [f2fs-dev] [PATCH] f2fs: free victim_secmap when pinned_secmap allocation fails

2024-07-21 Thread Chao Yu
On 2024/7/20 18:33, Yongpeng Yang wrote: In the init_victim_secmap function, if the allocation of dirty_i->pinned_secmap fails, dirty_i->victim_secmap is not freed, which can cause a memory leak. Signed-off-by: Yongpeng Yang --- fs/f2fs/segment.c | 4 +++- 1 file changed, 3 insertions(+), 1

[f2fs-dev] [PATCH v2] f2fs: test for race condition in between atomic_write and dio

2024-07-20 Thread Chao Yu
the transaction (via F2FS_IOC_COMMIT_ATOMIC_WRITE) This is a regression test to check handling of race condition in between atomic_write and direct IO. Cc: Jaegeuk Kim Cc: Daeho Jeong Signed-off-by: Chao Yu --- v2: - add kill&wait in _clean() to avoid umount failure - some cleanups - use expo

[f2fs-dev] [PATCH v2] f2fs: test for race condition in between atomic_write and gc

2024-07-20 Thread Chao Yu
transaction 6. check consistency of transaction This is a regression test to check handling of race condition in between atomic_write and GC. Cc: Jaegeuk Kim Cc: Daeho Jeong Signed-off-by: Chao Yu --- v2: - add kill&wait in _clean() to avoid umount failure - some cleanups - use exported hel

[f2fs-dev] [PATCH] f2fs-tools: clean up addrs_per_{inode,block}()

2024-07-17 Thread Chao Yu
Introduce a new help addrs_per_page() to wrap common code from addrs_per_inode() and addrs_per_block() for cleanup. Signed-off-by: Chao Yu --- include/f2fs_fs.h | 7 +++ lib/libf2fs.c | 13 +++-- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/include/f2fs_fs.h

[f2fs-dev] [PATCH] f2fs-tools: fix to add missing le32_to_cpu()/cpu_to_le32()

2024-07-17 Thread Chao Yu
This patch fixes some cases in where we missed to consider endianness when we access/update inode.i_flags. Signed-off-by: Chao Yu --- fsck/fsck.c| 9 + fsck/node.c| 2 +- include/f2fs_fs.h | 12 mkfs/f2fs_format.c | 2 +- 4 files changed, 11 insertions

[f2fs-dev] [PATCH] f2fs-tools: fix to do not dump inode if it has F2FS_NODUMP_FL flag

2024-07-17 Thread Chao Yu
Quoted from manual of chattr: " CHATTR(1) ... ATTRIBUTES A file with the 'd' attribute set is not a candidate for backup when the dump(8) program is run. " Once we set F2FS_NODUMP_FL flag to inode, do not allow dumping info from it. Signed-off-by: Chao Yu --- fsck/dum

Re: [f2fs-dev] [PATCH] f2fs: test for race condition in between atomic_write and dio

2024-07-16 Thread Chao Yu
On 2024/7/16 19:03, Zorro Lang wrote: On Tue, Jun 25, 2024 at 10:02:33PM +0800, Chao Yu wrote: In this patch, we simulate race case in between sqlite atomic write and direct IO w/ below steps: 1. create a regular file, and initialize it w/ 0xff data 2. start transaction (via

Re: [f2fs-dev] [PATCH] f2fs: test for race condition in between atomic_write and gc

2024-07-16 Thread Chao Yu
On 2024/7/16 18:57, Zorro Lang wrote: On Tue, Jun 25, 2024 at 11:04:16AM +0800, Chao Yu wrote: Test that we will simulate sqlite atomic write logic w/ below steps: 1. create a regular file, and initialize it w/ 0xff data 2. start transaction (via F2FS_IOC_START_ATOMIC_WRITE) on it 3. write

Re: [f2fs-dev] [PATCH v4] f2fs:Add write priority option based on zone UFS

2024-07-12 Thread Chao Yu
763,3 +763,17 @@ Date: November 2023 Contact: "Chao Yu" Description: It controls to enable/disable IO aware feature for background discard. By default, the value is 1 which indicates IO aware is on. + +What: /sys/fs/f2fs//blkzone_all

[f2fs-dev] [PATCH] f2fs: don't traverse directory blocks after EOF

2024-07-12 Thread Chao Yu
All directory blocks are within the scope of i_size, so let's limit the end_block to just check valid dirent blocks. Meanwhile, it uses dir_blocks() instead of variable for cleanup in __f2fs_find_entry(). Signed-off-by: Chao Yu --- fs/f2fs/dir.c | 6 -- 1 file changed, 4 insertions(

Re: [f2fs-dev] [PATCH] fsck.f2fs: update superblock if invalid

2024-07-12 Thread Chao Yu
rging them into an `invalid_sb' flags, and each of them is indicated using one bit. Signed-off-by: Sheng Yong Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge

Re: [f2fs-dev] [PATCH] fsck.f2fs: fix checking wp of all devices

2024-07-12 Thread Chao Yu
On 2024/7/12 10:01, Sheng Yong wrote: For zoned model, the first device (devices[0]) is not zoned device, whose zoned_model is not F2FS_ZONED_HM. Let's skip it and check write pointer of left devices continuously. Signed-off-by: Sheng Yong Reviewed-by: Chao Yu T

Re: [f2fs-dev] [PATCH] fsck.f2fs: check all-zero inline data with helper is_zeroed

2024-07-12 Thread Chao Yu
On 2024/7/12 10:01, 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] f2fs-tools: show device info of sb->devs

2024-07-12 Thread Chao Yu
[0x 80 : 128] 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] f2fs-tools: cleanup is_sit_bitmap_set

2024-07-12 Thread Chao Yu
On 2024/7/12 10:01, Sheng Yong wrote: Remove redundant function definition of is_sit_bitmap_set() and export it. Signed-off-by: Sheng Yong Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net

Re: [f2fs-dev] [RFC PATCH 0/5] Add inline tail support

2024-07-12 Thread Chao Yu
On 2024/7/10 9:33, Wu Bo wrote: The inode in F2FS occupies an entire 4k block. For many small files, this means they consume much more space than their actual size. Therefore, there is significant potential to better utilize the inode block space. Currently, F2FS has two features to make use of

[f2fs-dev] [PATCH v2 3/3] f2fs: clean up data_blkaddr() and get_dnode_addr()

2024-07-10 Thread Chao Yu
Introudce a new help get_dnode_base() to wrap common code from get_dnode_addr() and data_blkaddr() for cleanup. Signed-off-by: Chao Yu --- v2: - clean up get_dnode_base() and remove redundant declaration suggested by Jaegeuk. fs/f2fs/f2fs.h | 46 +- 1

Re: [f2fs-dev] [PATCH] inject.f2fs: install makefile

2024-07-10 Thread Chao Yu
On 2024/7/11 7:03, 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 v5] f2fs: reduce expensive checkpoint trigger frequency

2024-07-09 Thread Chao Yu
On 2024/7/9 16:40, wangzijie wrote: Hi Chao, I think that we should call f2fs_remove_ino_entry in f2fs_evict_inode to delete ino_entry in CP_XATTR_DIR list. wangzijie, For the case: - update parent's xattr - flush parent's metadata to disk - evict parent's inode - fsync child --- we should tr

Re: [f2fs-dev] [PATCH v3] f2fs:Add write priority option based on zone UFS

2024-07-09 Thread Chao Yu
Contact: "Chao Yu" Description: It controls to enable/disable IO aware feature for background discard. By default, the value is 1 which indicates IO aware is on. + +What: /sys/fs/f2fs//blkzone_alloc_policy +Date: July 2024 +Contact: &quo

Re: [f2fs-dev] [PATCH v2] f2fs: fix start segno of large section

2024-07-08 Thread Chao Yu
start segno. Fixes: 61461fc921b7 ("f2fs: fix to avoid touching checkpointed data in get_victim()") Signed-off-by: Sheng Yong Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge

Re: [f2fs-dev] [PATCH] f2fs: fix start segno of large section

2024-07-07 Thread Chao Yu
On 2024/7/6 17:16, Sheng Yong wrote: get_ckpt_valid_blocks() checks valid ckpt blocks in current section. It counts all vblocks from the first to the last segment in the large section. However, START_SEGNO() is used to get the first segno in an SIT block. This patch fixes that to get the correct

Re: [f2fs-dev] [PATCH v2] f2fs:Add write priority option based on zone UFS

2024-07-07 Thread Chao Yu
--- a/Documentation/ABI/testing/sysfs-fs-f2fs +++ b/Documentation/ABI/testing/sysfs-fs-f2fs @@ -763,3 +763,17 @@ Date: November 2023 Contact: "Chao Yu" Description: It controls to enable/disable IO aware feature for background discard. By default,

Re: [f2fs-dev] [PATCH v2 2/2] f2fs: use meta inode for GC of COW file

2024-07-07 Thread Chao Yu
Signed-off-by: Sunmin 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 v2 1/2] f2fs: use meta inode for GC of atomic file

2024-07-07 Thread Chao Yu
file by using the meta inode for GC writes. Fixes: 3db1de0e582c ("f2fs: change the current atomic write way") Cc: sta...@vger.kernel.org #v5.19+ Reviewed-by: Sungjong Seo Reviewed-by: Yeongjin Gil Signed-off-by: Sunmin Jeong Review

Re: [f2fs-dev] [PATCH 1/2] f2fs: use meta inode for GC of atomic file

2024-07-04 Thread Chao Yu
On 2024/7/5 11:25, Sunmin Jeong wrote: Hi Chao Yu, The page cache of the atomic file keeps new data pages which will be stored in the COW file. It can also keep old data pages when GCing the atomic file. In this case, new data can be overwritten by old data if a GC thread sets the old data

Re: [f2fs-dev] (2) [PATCH] f2fs: fix null reference error when checking end of zone

2024-07-04 Thread Chao Yu
On 2024/7/4 15:55, Daejun Park wrote: Hi Chao Yu, - Original Message - Sender : Chao Yu Date : 2024-07-04 16:16 (GMT+9) Title : Re: [PATCH] f2fs: fix null reference error when checking end of zone On 2024/7/4 9:01, Daejun Park wrote: This patch fixes a potentially null

Re: [f2fs-dev] [PATCH] f2fs:Add write priority option based on zone UFS

2024-07-04 Thread Chao Yu
On 2024/7/2 14:29, Liao Yuanhong wrote: Currently, we are using a mix of traditional UFS and zone UFS to support some functionalities that cannot be achieved on zone UFS alone. However, there are some issues with this approach. There exists a significant performance difference between traditional

Re: [f2fs-dev] [PATCH 2/2] f2fs: use meta inode for GC of COW file

2024-07-04 Thread Chao Yu
On 2024/7/2 20:06, Sunmin Jeong wrote: In case of the COW file, new updates and GC writes are already separated to page caches of the atomic file and COW file. As some cases that use the meta inode for GC, there are some race issues between a foreground thread and GC thread. To handle them, we n

Re: [f2fs-dev] [PATCH 1/2] f2fs: use meta inode for GC of atomic file

2024-07-04 Thread Chao Yu
On 2024/7/2 20:06, Sunmin Jeong wrote: The page cache of the atomic file keeps new data pages which will be stored in the COW file. It can also keep old data pages when GCing the atomic file. In this case, new data can be overwritten by old data if a GC thread sets the old data page as dirty afte

Re: [f2fs-dev] [PATCH] f2fs: fix null reference error when checking end of zone

2024-07-04 Thread Chao Yu
On 2024/7/4 9:01, Daejun Park wrote: This patch fixes a potentially null pointer being accessed by is_end_zone_blkaddr() that checks the last block of a zone when f2fs is mounted as a single device. blkzoned feature depends on multiple device feature? One regular device and one seq-zone device?

Re: [f2fs-dev] [RCF PATCH v3 09/10] inject.f2fs: add dentry injection

2024-07-03 Thread Chao Yu
d_bitmap of nid * d_hash: dentry hash * d_ino: dentry ino * d_ftype: dentry ftype 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

Re: [f2fs-dev] [RCF PATCH v3 03/10] inject.f2fs: add sb injection

2024-07-03 Thread Chao Yu
members could be injected in sb contains: * magic: magic number * s_stop_reason: s_stop_reason array * s_errors: s_errors array * devs.path: path in devs array Signed-off-by: Sheng Yong Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing

Re: [f2fs-dev] [RCF PATCH v3 00/10] f2fs-tools: introduce inject.f2fs

2024-07-03 Thread Chao Yu
On 2024/7/4 10:57, Sheng Yong wrote: This patchset introduces a new tool inject.f2fs to modify metadata or data (directory entry) of f2fs image offline flexibly. With inject.f2fs, it is easier to generate a corrupted f2fs image, which can help verify fsck or reproduce userspace behaviors of some

Re: [f2fs-dev] [RFC PATCH v2 10/10] man: add inject.f2fs man page

2024-07-02 Thread Chao Yu
On 2024/6/28 9:31, 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] [RFC PATCH v2 09/10] inject.f2fs: add dentry injection

2024-07-02 Thread Chao Yu
On 2024/6/28 9:31, Sheng Yong wrote: This patch enables injecting dentry block or dir entry. print_raw_dentry_info() is added to show values of node footer. The meanings of options are: * dent: means dentry is injected. The members could be injected in cp contains: * d_bitmap: dentry block

Re: [f2fs-dev] [RFC PATCH v2 08/10] inject.f2fs: add node injection

2024-07-01 Thread Chao Yu
i_extra_isize * i_inode_checksum: inode i_inode_checksum * i_addr: inode i_addr array * i_nid: inode i_nid array * addr: {in}direct node nid/addr array Signed-off-by: Sheng Yong Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list

Re: [f2fs-dev] [RFC PATCH v2 07/10] inject.f2fs: add ssa injection

2024-07-01 Thread Chao Yu
could be injected in cp contains: * entry_type: summary block footer entry_type * check_sum: summary block footer check_sum * nid: summary entry nid * version: summary entry version * ofs_in_node: summary entry ofs_in_node Signed-off-by: Sheng Yong Reviewed-by: Chao Yu Thanks

Re: [f2fs-dev] [RFC PATCH v2 06/10] inject.f2fs: add sit injection

2024-07-01 Thread Chao Yu
current valid sit is choosen automatically. * blk: is the block address of the sit entry. The members could be injected in cp contains: * vblocks: sit entry vblocks * valid_map: sit entry valid_map * mtime: sit entry mtime Signed-off-by: Sheng Yong Reviewed-by: Chao Yu Thanks

<    1   2   3   4   5   6   7   8   9   10   >