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

2024-07-01 Thread Chao Yu
array * cur_node_blkoff: cur_node_blkoff array * cur_data_segno: cur_data_segno array * cur_data_blkoff: cur_data_blkoff array Signed-off-by: Sheng Yong Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel

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

2024-07-01 Thread Chao Yu
On 2024/6/28 9:31, Sheng Yong wrote: This patch enables injecting super block. The meanings of options are: * sb: means sb is injected, its argument chooses which sb pack to be injected, where 0 means the current valid sb is choosen automatically. * mb: indicates which member

Re: [f2fs-dev] [RFC PATCH v2 02/10] inject.f2fs: introduce inject.f2fs

2024-07-01 Thread Chao Yu
fault. If option `--dry-run' is used, nothing really gets changed, and that could be used to get the value of a specified field. The following patches enable injecting each part of f2fs. Signed-off-by: Sheng Yong Reviewed-by: Chao Yu T

Re: [f2fs-dev] [PATCH] f2fs: remove unreachable lazytime mount option parsing

2024-07-01 Thread Chao Yu
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 01/10] f2fs-tools: export is_digits

2024-07-01 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

[f2fs-dev] [PATCH] f2fs: fix to wait dio completion

2024-06-27 Thread Chao Yu
It should wait all existing dio write IOs before block removal, otherwise, previous direct write IO may overwrite data in the block which may be reused by other inode. Cc: sta...@vger.kernel.org Signed-off-by: Chao Yu --- fs/f2fs/file.c | 13 + 1 file changed, 13 insertions(+) diff

[f2fs-dev] [PATCH v3] f2fs: fix to avoid racing in between read and OPU dio write

2024-06-27 Thread Chao Yu
around IO paths. Fixes: f847c699cff3 ("f2fs: allow out-place-update for direct IO in LFS mode") Signed-off-by: Chao Yu --- v3: - wait for direct IO's completion before read IO. fs/f2fs/file.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/f2fs/file.c b/fs/f2fs/

Re: [f2fs-dev] [PATCH v2] f2fs: fix to avoid racing in between read and OPU dio write

2024-06-26 Thread Chao Yu
On 2024/6/26 10:01, Zhiguo Niu wrote: Chao Yu 于2024年6月25日周二 22:29写道: If lfs mode is on, buffered read may race w/ OPU dio write as below, it may cause buffered read hits unwritten data unexpectly, and for dio read, the race condition exists as well. Thread AThread B

[f2fs-dev] [PATCH v5] f2fs: reduce expensive checkpoint trigger frequency

2024-06-25 Thread Chao Yu
st xattrs of directories") Reported-by: wangzijie Reported-by: Zhiguo Niu Tested-by: Zhiguo Niu Reported-by: Yunlei He Signed-off-by: Chao Yu --- v5: - update related enumeration type declaration. fs/f2fs/f2fs.h | 2 ++ fs/f2fs/file.c | 3 +++ fs/f2fs/xattr.c

Re: [f2fs-dev] 答复: [PATCH v4] f2fs: reduce expensive checkpoint trigger frequency

2024-06-25 Thread Chao Yu
On 2024/6/25 19:07, Zhiguo Niu wrote: Chao Yu 于2024年6月25日周二 18:38写道: On 2024/6/25 16:09, 牛志国 (Zhiguo Niu) wrote: -邮件原件- 发件人: Chao Yu 发送时间: 2024年6月25日 14:55 收件人: jaeg...@kernel.org 抄送: linux-f2fs-devel@lists.sourceforge.net; linux-ker...@vger.kernel.org; Chao Yu ; wangzijie ; 牛志国

[f2fs-dev] [PATCH v2] f2fs: fix to avoid racing in between read and OPU dio write

2024-06-25 Thread Chao Yu
ock around IO paths. Fixes: f847c699cff3 ("f2fs: allow out-place-update for direct IO in LFS mode") 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 278573974db4..866f1a34e92b 100644 --- a/fs/f2fs/

Re: [f2fs-dev] [PATCH v2] f2fs: only fragment segment in the same section

2024-06-25 Thread Chao Yu
>segno to make get_new_segment() itself find the next free segment. * if curseg is in the middle of the secion, select candicate randomly in the range of [curseg + 1, last_seg_in_the_same_section] to keep type consistent. Signed-off-by: Sheng Yong Reviewed-by: Chao Yu

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

2024-06-25 Thread Chao Yu
it fails or not 5. commit and end 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 --- tests/f2fs/004 | 45

Re: [f2fs-dev] 答复: [PATCH v4] f2fs: reduce expensive checkpoint trigger frequency

2024-06-25 Thread Chao Yu
On 2024/6/25 16:09, 牛志国 (Zhiguo Niu) wrote: -邮件原件- 发件人: Chao Yu 发送时间: 2024年6月25日 14:55 收件人: jaeg...@kernel.org 抄送: linux-f2fs-devel@lists.sourceforge.net; linux-ker...@vger.kernel.org; Chao Yu ; wangzijie ; 牛志国 (Zhiguo Niu) ; Yunlei He 主题: [PATCH v4] f2fs: reduce expensive

[f2fs-dev] [PATCH v4] f2fs: reduce expensive checkpoint trigger frequency

2024-06-24 Thread Chao Yu
st xattrs of directories") Reported-by: wangzijie Reported-by: Zhiguo Niu Tested-by: Zhiguo Niu Reported-by: Yunlei He Signed-off-by: Chao Yu --- fs/f2fs/f2fs.h | 2 ++ fs/f2fs/file.c | 3 +++ fs/f2fs/xattr.c | 14 -- include/trace/eve

Re: [f2fs-dev] [PATCH v3] f2fs: reduce expensive checkpoint trigger frequency

2024-06-24 Thread Chao Yu
by: Zhiguo Niu Tested-by: Zhiguo Niu Reported-by: Yunlei He Signed-off-by: Chao Yu --- v3: - Recently, Zhiguo Niu reported the same issue, so I repost this patch for comments. fs/f2fs/f2fs.h | 2 ++ fs/f2fs/file.c | 3 +++ fs/f2fs/xattr.c | 16 +++

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

2024-06-24 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 --- fs/f2fs/f2fs.h | 20 +++- include/linux/f2fs_fs.h | 7 +++ 2 files changed, 10 insertions(+), 17 deletions(-) diff --git

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

2024-06-24 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 --- fs/f2fs/f2fs.h | 46 +++--- 1 file changed, 19 insertions(+), 27 deletions(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs

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

2024-06-24 Thread Chao Yu
Use temporary variable instead of F2FS_I() for cleanup. Signed-off-by: Chao Yu --- fs/f2fs/f2fs.h | 32 ++- fs/f2fs/file.c | 64 -- fs/f2fs/inode.c| 54 +- fs/f2fs/namei.c| 20

[f2fs-dev] [PATCH 1/4] f2fs: atomic: fix to avoid racing w/ GC

2024-06-24 Thread Chao Yu
tebacked into cow_file, if the flag is not tagged in page, we should never write data across files. Fixes: 3db1de0e582c ("f2fs: change the current atomic write way") Cc: Daeho Jeong Signed-off-by: Chao Yu --- v1: - this patch can fix on-disk data consistency issue caused by f2fs/003

[f2fs-dev] [PATCH 4/4] f2fs: atomic: fix to forbid dio in atomic_file

2024-06-24 Thread Chao Yu
atomic write can only be used via buffered IO, let's fail direct IO on atomic_file and return -EOPNOTSUPP. Signed-off-by: Chao Yu --- fs/f2fs/file.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 0355cb054521..a527de1e7a2f 100644

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

2024-06-24 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 --- fs/f2fs/file.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 2203904383a6..0355cb054

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

2024-06-24 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 --- v1: - this patch can fix in-memory data consistency issue caused by f2fs/003 fs/f2fs/segment.c | 24 +--- 1 file changed,

[f2fs-dev] [PATCH v2] f2fs: fix to update user block counts in block_operations()

2024-06-24 Thread Chao Yu
count, .alloc_valid_block_count and .rf_node_block_count in block_operations(), then their access can be protected by .node_change and .cp_rwsem lock, so that it can avoid above race condition. Fixes: 59c9081bc86e ("f2fs: allow write page cache when writting cp") Cc: Yunlei He Signed-of

Re: [f2fs-dev] [PATCH] f2fs: fix to update user block counts in block_operations()

2024-06-24 Thread Chao Yu
On 2024/6/25 1:53, Jaegeuk Kim wrote: On 06/06, Chao Yu wrote: Commit 59c9081bc86e ("f2fs: allow write page cache when writting cp") allows write() to write data to page cache during checkpoint, so block count fields like .total_valid_block_count, .alloc_valid_block

Re: [f2fs-dev] [PATCH 1/2] f2fs: fix to add missing sb_{start, end}_intwrite() for ckpt thread

2024-06-23 Thread Chao Yu
Hi all, Please ignore this patch, because during freeze_super(), it will call sync_fs() to clear all dirty data, there should be no race case after that. Thanks, On 2024/6/10 23:10, Daeho Jeong wrote: On Sat, Jun 8, 2024 at 5:36 AM Chao Yu wrote: On 2024/6/6 17:52, Chao Yu wrote: After

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

2024-06-20 Thread Chao Yu
On 2024/6/20 15:56, Daejun Park wrote: On 2024/6/20 15:22, Daejun Park wrote: On 2024/6/20 13:56, Daejun Park wrote: Hi Chao, Jaegeuk, Quoted commit message from commit c550e25bca66 ("f2fs: use flush command instead of FUA for zoned device") " The block layer for zoned disk can reorder the F

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

2024-06-20 Thread Chao Yu
On 2024/6/20 15:22, Daejun Park wrote: On 2024/6/20 13:56, Daejun Park wrote: Hi Chao, Jaegeuk, Quoted commit message from commit c550e25bca66 ("f2fs: use flush command instead of FUA for zoned device") " The block layer for zoned disk can reorder the FUA'ed IOs. Let's use flush command to ke

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

2024-06-20 Thread Chao Yu
On 2024/6/20 13:56, Daejun Park wrote: Hi Chao, Jaegeuk, Quoted commit message from commit c550e25bca66 ("f2fs: use flush command instead of FUA for zoned device") " The block layer for zoned disk can reorder the FUA'ed IOs. Let's use flush command to keep the write order. " It seems mq-deadl

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

2024-06-19 Thread Chao Yu
Jaegeuk, Quoted commit message from commit c550e25bca66 ("f2fs: use flush command instead of FUA for zoned device") " The block layer for zoned disk can reorder the FUA'ed IOs. Let's use flush command to keep the write order. " It seems mq-deadline use fifo queue and make queue depth of zone dev

Re: [f2fs-dev] [PATCH 2/2] f2fs: fix to use sb_{start, end}_intwrite{_trylock, }() in gc_thread_func()

2024-06-19 Thread Chao Yu
On 2024/6/6 17:52, Chao Yu wrote: Since background GC is f2fs inner operation, so, let's use sb_{start,end}_intwrite{_trylock,}() instead of sb_{start,end}_write{_trylock,}() in gc_thread_func(). It may cause racing in between gc_thread and freeze_super(), result in writeback of dirty

Re: [f2fs-dev] [PATCH v2] f2fs: add support single node mode

2024-06-19 Thread Chao Yu
On 2024/6/17 12:51, Daejun Park wrote: The amount of node writes is small compared to the amount of user data writes in most workloads. Therefore, even if there is enough free space in the node section, it cannot be used by another type because the type for its section is fixed. When using zoned

[f2fs-dev] [PATCH] f2fs: atomic: fix to avoid racing w/ GC

2024-06-19 Thread Chao Yu
tebacked into cow_file, if the flag is not tagged in page, we should never write data across files. Fixes: 3db1de0e582c ("f2fs: change the current atomic write way") Cc: Daeho Jeong Signed-off-by: Chao Yu --- fs/f2fs/data.c | 10 +- fs/f2fs/f2fs.h | 8 +++- 2 files change

Re: [f2fs-dev] [PATCH] dump.f2fs: Add help description for -rfyPo

2024-06-18 Thread Chao Yu
On 2024/6/19 9:25, Daniel Rosenberg wrote: These were described in man pages, but not within the help message. Signed-off-by: Daniel Rosenberg Can you please check below patch? https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/commit/?h=dev-test&id=c07b0954506a159f68358e

Re: [f2fs-dev] [PATCH] f2fs: assign CURSEG_ALL_DATA_ATGC if blkaddr is valid

2024-06-18 Thread Chao Yu
flag by set_cluster_dirty(). Cc: sta...@vger.kernel.org Fixes: 4961acdd65c9 ("f2fs: fix to tag gcing flag on page during block migration") Signed-off-by: Jaegeuk Kim Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-

Re: [f2fs-dev] [PATCH] f2fs-tools: fix do_set_verity ioctl fail issue

2024-06-18 Thread Chao Yu
igned-off-by: Zhiguo Niu 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: fix do_set_verity ioctl fail issue

2024-06-18 Thread Chao Yu
On 2024/6/18 13:35, Xiuhong Wang wrote: Chao Yu 于2024年6月18日周二 11:04写道: On 2024/6/17 15:11, Xiuhong Wang wrote: When using the f2fs_io tool to set_verity, it will fail as follows: unisc:/data # ./f2fs_io set_verity file FS_IOC_ENABLE_VERITY: Inappropriate ioctl for device this is because

[f2fs-dev] [PATCH v3] f2fs: get rid of buffer_head use

2024-06-18 Thread Chao Yu
Convert to use folio and related functionality. Cc: Matthew Wilcox Signed-off-by: Chao Yu --- - support large folio - use bd_mapping instead of bd_inode->i_mapping fs/f2fs/data.c | 1 - fs/f2fs/f2fs.h | 11 +- fs/f2fs/file.c | 1 - fs/f2fs/inode.c | 1 - fs/f2fs/super.c |

Re: [f2fs-dev] [PATCH] f2fs-tools: fix do_set_verity ioctl fail issue

2024-06-17 Thread Chao Yu
On 2024/6/17 15:11, Xiuhong Wang wrote: When using the f2fs_io tool to set_verity, it will fail as follows: unisc:/data # ./f2fs_io set_verity file FS_IOC_ENABLE_VERITY: Inappropriate ioctl for device this is because commit: 95ae251fe828 ("f2fs: add fs-verity support"), the passed parameters do n

Re: [f2fs-dev] [PATCH] dump.f2fs: Fix dumping inlined files

2024-06-17 Thread Chao Yu
On 2024/6/18 8:41, Daniel Rosenberg wrote: The code for dumping files was ignoring i_extra_isize, leading to invalid data for some inlined files after dumping. This swaps inode dumping to use the common inline_data_addr function. Signed-off-by: Daniel Rosenberg Reviewed-by: Chao Yu Thanks

Re: [f2fs-dev] [PATCH] f2fs: add scope based f2fs_putname() cleanup

2024-06-17 Thread Chao Yu
On 2024/6/12 7:39, jtp.p...@samsung.com wrote: From: Jeongtae Park This patch adds a new scope based f2fs_putname() cleanup to reduce the chances of forgetting a f2fs_putname(). And doing so removes Actually, f2fs_trace_rw_file_path() won't change frequently, so the risk of forgetting f2fs_pu

Re: [f2fs-dev] [PATCH 1/1] f2fs-tools: use atoll replace atoi to avoid data truncate

2024-06-17 Thread Chao Yu
=3221225000 Signed-off-by: Xiuhong Wang Signed-off-by: Zhiguo Niu 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: clean up set REQ_RAHEAD given rac

2024-06-17 Thread Chao Yu
On 2024/6/13 3:38, Jaegeuk Kim wrote: Let's set REQ_RAHEAD per rac by single source. Signed-off-by: Jaegeuk Kim Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforg

Re: [f2fs-dev] [PATCH] f2fs: fix to use mnt_{want, drop}_write_file replace file_{start, end}_wrtie

2024-06-17 Thread Chao Yu
On 2024/6/13 17:35, Zhiguo Niu wrote: mnt_{want,drop}_write_file is more suitable than file_{start,end}_wrtie and also is consistent with other ioctl operations. Signed-off-by: Zhiguo Niu Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel

Re: [f2fs-dev] [PATCH] f2fs: fix convert inline inode on readonly mode

2024-06-11 Thread Chao Yu
On 2024/6/12 10:20, Daejun Park wrote: syzbot reported a bug in f2fs_vm_page_mkwrite() which checks for f2fs_has_inline_data(inode). The bug was caused by f2fs_convert_inline_inode() not returning an error when called on a read-only filesystem, but returning with the inline attribute as set. This

Re: [f2fs-dev] [PATCH 1/2] f2fs: fix to add missing sb_{start, end}_intwrite() for ckpt thread

2024-06-08 Thread Chao Yu
On 2024/6/6 17:52, Chao Yu wrote: After commit 261eeb9c1585 ("f2fs: introduce checkpoint_merge mount option"), checkpoint can be triggered in background thread, it missed to cover f2fs inner checkpoint operation w/ sb_{start,end}_intwrite(), fix it. It needs to use sb_start_intwri

Re: [f2fs-dev] [PATCH v2] f2fs: get rid of buffer_head use

2024-06-07 Thread Chao Yu
On 2024/6/7 21:33, Matthew Wilcox wrote: On Fri, Jun 07, 2024 at 06:18:29PM +0800, Chao Yu wrote: @@ -1990,6 +1989,12 @@ static inline struct f2fs_super_block *F2FS_RAW_SUPER(struct f2fs_sb_info *sbi) return (struct f2fs_super_block *)(sbi->raw_super); } +static inline str

Re: [f2fs-dev] [PATCH V2] f2fs: enable atgc dynamically if conditions are met

2024-06-07 Thread Chao Yu
me and ATGC mount option is on. Signed-off-by: Chao Yu Signed-off-by: Zhiguo Niu 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: get rid of buffer_head use

2024-06-07 Thread Chao Yu
Convert to use folio and related functionality. Cc: Matthew Wilcox Signed-off-by: Chao Yu --- v2: - convert to use folio rather than page suggested by Matthew. fs/f2fs/data.c | 1 - fs/f2fs/f2fs.h | 7 +++- fs/f2fs/file.c | 1 - fs/f2fs/inode.c | 1 - fs/f2fs/super.c | 94

Re: [f2fs-dev] [PATCH] f2fs: get rid of buffer_head use

2024-06-06 Thread Chao Yu
On 2024/6/6 20:38, Matthew Wilcox wrote: On Thu, Jun 06, 2024 at 05:50:37PM +0800, Chao Yu wrote: For later folio conversion. What tree is this against? Last dev-test branch of f2fs git tree, I guess it's a little behind to linus' tree. @@ -3957,32 +3976,32 @@

Re: [f2fs-dev] [PATCH v2] f2fs: fix to avoid racing in between read and OPU dio write

2024-06-06 Thread Chao Yu
On 2024/5/15 14:38, Chao Yu wrote: On 2024/5/15 12:42, Jaegeuk Kim wrote: On 05/15, Chao Yu wrote: On 2024/5/15 0:09, Jaegeuk Kim wrote: On 05/10, Chao Yu wrote: If lfs mode is on, buffered read may race w/ OPU dio write as below, it may cause buffered read hits unwritten data unexpectly

Re: [f2fs-dev] [PATCH v2] f2fs: fix to avoid racing in between read and OPU dio write

2024-06-06 Thread Chao Yu
On 2024/5/15 16:32, Wu Bo wrote: On Fri, May 10, 2024 at 10:39:06AM +0800, Chao Yu wrote: If lfs mode is on, buffered read may race w/ OPU dio write as below, it may cause buffered read hits unwritten data unexpectly, and for dio read, the race condition exists as well. Thread A

[f2fs-dev] [PATCH] f2fs: remove redundant sanity check in sanity_check_inode()

2024-06-06 Thread Chao Yu
Commit f240d3aaf5a1 ("f2fs: do more sanity check on inode") missed to remove redundant sanity check on flexible_inline_xattr flag, fix it. Signed-off-by: Chao Yu --- fs/f2fs/inode.c | 4 1 file changed, 4 deletions(-) diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index 87

[f2fs-dev] [PATCH] f2fs: fix to update user block counts in block_operations()

2024-06-06 Thread Chao Yu
count, .alloc_valid_block_count and .rf_node_block_count in block_operations(), then their access can be protected by .node_change and .cp_rwsem lock, so that it can avoid above race condition. Fixes: 59c9081bc86e ("f2fs: allow write page cache when writting cp") Cc: Yunlei He Signed-off

[f2fs-dev] [PATCH 1/2] f2fs: fix to add missing sb_{start, end}_intwrite() for ckpt thread

2024-06-06 Thread Chao Yu
ion") Cc: Daeho Jeong Signed-off-by: Chao Yu --- fs/f2fs/checkpoint.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index 55d444bec5c0..66eaad591b60 100644 --- a/fs/f2fs/checkpoint.c +++ b/fs/f2fs/checkpoint.c @@ -1828,8 +1

[f2fs-dev] [PATCH 2/2] f2fs: fix to use sb_{start, end}_intwrite{_trylock, }() in gc_thread_func()

2024-06-06 Thread Chao Yu
Since background GC is f2fs inner operation, so, let's use sb_{start,end}_intwrite{_trylock,}() instead of sb_{start,end}_write{_trylock,}() in gc_thread_func(). Signed-off-by: Chao Yu --- fs/f2fs/gc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/gc.c

[f2fs-dev] [PATCH] f2fs: get rid of buffer_head use

2024-06-06 Thread Chao Yu
For later folio conversion. Cc: Matthew Wilcox Signed-off-by: Chao Yu --- v1: - I checked recovery flow of superblock w/ below testcase, it passes. 1. mkfs.f2fs /dev/vdd 2. dd if=/dev/zero of=/dev/vdd bs=4k count=1 3. mount /dev/vdd /mnt/f2fs 4. umount /mnt/f2fs 5. dd if=/dev/zero of=/dev/vdd

Re: [f2fs-dev] [PATCH] f2fs: enable atgc if atgc_age_threshold from user is less than elapsed_time

2024-06-04 Thread Chao Yu
On 2024/6/5 13:59, Zhiguo Niu wrote: On Wed, Jun 5, 2024 at 11:48 AM Chao Yu wrote: On 2024/6/3 17:05, Zhiguo Niu wrote: On Mon, Jun 3, 2024 at 3:41 PM Chao Yu wrote: On 2024/5/20 19:36, Zhiguo Niu wrote: Now atgc can be enabled based on the following conditions: -ATGC mount option is

Re: [f2fs-dev] [PATCH] f2fs: enable atgc if atgc_age_threshold from user is less than elapsed_time

2024-06-04 Thread Chao Yu
On 2024/6/3 17:05, Zhiguo Niu wrote: On Mon, Jun 3, 2024 at 3:41 PM Chao Yu wrote: On 2024/5/20 19:36, Zhiguo Niu wrote: Now atgc can be enabled based on the following conditions: -ATGC mount option is set -elapsed_time is more than atgc_age_threshold already but these conditions are check

Re: [f2fs-dev] [syzbot] [f2fs?] INFO: task hung in f2fs_balance_fs

2024-06-04 Thread Chao Yu
#syz test: https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git wip On 2023/3/26 13:17, syzbot wrote: syzbot has found a reproducer for the following issue on: HEAD commit:4bdec23f971b Merge tag 'hwmon-for-v6.3-rc4' of git://git.k.. git tree: upstream console+strace: https:/

Re: [f2fs-dev] [syzbot] [f2fs?] kernel BUG in f2fs_evict_inode (2)

2024-06-04 Thread Chao Yu
#syz test: https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git wip On 2023/11/8 23:01, syzbot wrote: Hello, syzbot found the following issue on: HEAD commit:90b0c2b2edd1 Merge tag 'pinctrl-v6.7-1' of git://git.kerne.. git tree: upstream console+strace: https://syzkaller.ap

[f2fs-dev] [PATCH] f2fs: fix to don't dirty inode for readonly filesystem

2024-06-04 Thread Chao Yu
loses: https://lore.kernel.org/linux-f2fs-devel/e890bc0609a55...@google.com Signed-off-by: Chao Yu --- fs/f2fs/inode.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index 8f2b9f62ef73..64cda1d77fe5 100644 --- a/fs/f2fs/inode.c +++ b/fs

Re: [f2fs-dev] [PATCH V2] f2fs: use new ioprio Macro to get ckpt thread ioprio level

2024-06-03 Thread Chao Yu
). Besides, change variable name from "data" to "level" for more readable. Signed-off-by: Zhiguo Niu 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: use new ioprio Macro to get ckpt thread ioprio data

2024-06-03 Thread Chao Yu
On 2024/6/3 14:52, Zhiguo Niu wrote: On Mon, Jun 3, 2024 at 2:39 PM Chao Yu wrote: On 2024/5/31 17:10, Zhiguo Niu wrote: Use new Macro IOPRIO_PRIO_LEVEL to get ckpt thread ioprio data(level), it is more accurate and consisten with the way setting ckpt thread ioprio(IOPRIO_PRIO_VALUE(class

Re: [f2fs-dev] [PATCH] f2fs: enable atgc if atgc_age_threshold from user is less than elapsed_time

2024-06-03 Thread Chao Yu
On 2024/5/20 19:36, Zhiguo Niu wrote: Now atgc can be enabled based on the following conditions: -ATGC mount option is set -elapsed_time is more than atgc_age_threshold already but these conditions are check when umounted->mounted device again. If the device has not be umounted->mounted for a lon

Re: [f2fs-dev] [PATCH] f2fs: use new ioprio Macro to get ckpt thread ioprio data

2024-06-02 Thread Chao Yu
On 2024/5/31 17:10, Zhiguo Niu wrote: Use new Macro IOPRIO_PRIO_LEVEL to get ckpt thread ioprio data(level), it is more accurate and consisten with the way setting ckpt thread ioprio(IOPRIO_PRIO_VALUE(class, data)). Signed-off-by: Zhiguo Niu --- fs/f2fs/sysfs.c | 2 +- 1 file changed, 1 inse

[f2fs-dev] [PATCH] f2fs: fix return value of f2fs_convert_inline_inode()

2024-06-02 Thread Chao Yu
l.com Closes: https://lore.kernel.org/linux-f2fs-devel/d103ce06174d7...@google.com Signed-off-by: Chao Yu --- fs/f2fs/inline.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c index 0203c3baabb6..1fba5728be70 100644 --- a/fs

Re: [f2fs-dev] [syzbot] [f2fs?] kernel BUG in f2fs_write_inline_data

2024-06-02 Thread Chao Yu
#syz test: https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git wip On 2024/6/1 19:50, syzbot wrote: syzbot has found a reproducer for the following issue on: HEAD commit:0e1980c40b6e Add linux-next specific files for 20240531 git tree: linux-next console+strace: https://syz

Re: [f2fs-dev] [syzbot] [f2fs?] kernel BUG in f2fs_write_inline_data

2024-06-01 Thread Chao Yu
#syz test: https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git wip On 2024/6/1 19:50, syzbot wrote: syzbot has found a reproducer for the following issue on: HEAD commit:0e1980c40b6e Add linux-next specific files for 20240531 git tree: linux-next console+strace: https://syz

Re: [f2fs-dev] [PATCH] f2fs: enable atgc if atgc_age_threshold from user is less than elapsed_time

2024-05-30 Thread Chao Yu
On 2024/5/30 17:49, Zhiguo Niu wrote: On Mon, May 27, 2024 at 12:07 PM Zhiguo Niu wrote: On Mon, May 27, 2024 at 11:49 AM Chao Yu wrote: On 2024/5/20 19:36, Zhiguo Niu wrote: Now atgc can be enabled based on the following conditions: -ATGC mount option is set -elapsed_time is more than

[f2fs-dev] [PATCH v2] f2fs: fix to cover read extent cache access with lock

2024-05-30 Thread Chao Yu
433e9dc6...@syzkaller.appspotmail.com Closes: https://lore.kernel.org/linux-f2fs-devel/09beea061740a...@google.com Signed-off-by: Chao Yu --- v2: - fix typo in commit message: w/ -> w/o fs/f2fs/extent_cache.c | 48 +- fs/f2fs/f2fs.h | 2 +- fs/f

[f2fs-dev] [PATCH] dump.f2fs: update dump_usage() for directory dumping

2024-05-30 Thread Chao Yu
Add missing usage for directory dumping functionality of dump.f2fs as below: -r dump out from the root inode -f do not prompt before dumping -y alias for -f -o dump inodes to the given path -P preserve mode/owner/group for dumped inode Cc: Daniel Rosenberg Signed-off-by: Chao Yu

Re: [f2fs-dev] [syzbot] [f2fs?] KASAN: slab-use-after-free Read in sanity_check_extent_cache

2024-05-30 Thread Chao Yu
: https://storage.googleapis.com/syzbot-assets/ec3f54fc8985/bzImage-e67572cd.xz mounted in repro: https://storage.googleapis.com/syzbot-assets/21aa65da230a/mount_0.gz The issue was bisected to: commit a53936361330e4c55c0654605178281387d9c761 Author: Chao Yu Date: Sun Dec 10 09:20:35 2023

Re: [f2fs-dev] [PATCH v4 1/2] dump.f2fs: Add ability to dump folders

2024-05-30 Thread Chao Yu
On 2024/5/31 7:41, Jaegeuk Kim wrote: On 05/29, Chao Yu wrote: On 2024/5/24 6:46, Daniel Rosenberg wrote: This adds the ability to dump folders as well as files. Folders are dumped recursively. Additionally, dumped files/folders may be directed to a folder specified by -o [path] instead of

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

2024-05-30 Thread Chao Yu
On 2024/5/31 7:39, Jaegeuk Kim wrote: On 05/29, Chao Yu wrote: Ping, Jaegeuk, Chao, sorry, I might need some time to take a look at the change cautiously. No problem, I've done some tests on this patch, though, I will keeping this in my queue, and do test base on the queue whenev

Re: [f2fs-dev] [PATCH] f2fs: avoid resetting non empty zone

2024-05-29 Thread Chao Yu
, stop checkpoint dd: error writing '/mnt/testfile': Input/output error 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/list

Re: [f2fs-dev] [syzbot] [f2fs?] KASAN: slab-use-after-free Read in sanity_check_extent_cache

2024-05-29 Thread Chao Yu
: https://storage.googleapis.com/syzbot-assets/ec3f54fc8985/bzImage-e67572cd.xz mounted in repro: https://storage.googleapis.com/syzbot-assets/21aa65da230a/mount_0.gz The issue was bisected to: commit a53936361330e4c55c0654605178281387d9c761 Author: Chao Yu Date: Sun Dec 10 09:20:35 2023

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

2024-05-29 Thread Chao Yu
Ping, On 2024/4/23 10:07, Chao Yu wrote: Jaegeuk, any comments for this serials? On 2024/4/11 16:23, Chao Yu wrote: After commit 899fee36fac0 ("f2fs: fix to avoid data corruption by forbidding SSR overwrite"), valid block bitmap of current openned segment is fixed, let's intr

[f2fs-dev] [PATCH v2] f2fs: fix to truncate preallocated blocks in f2fs_file_open()

2024-05-29 Thread Chao Yu
t;f2fs: do not expose unwritten blocks to user by DIO") Reported-by: chenyuwen Closes: https://lore.kernel.org/linux-kernel/20240517085327.1188515-1-yuwen.c...@xjmz.com Signed-off-by: Chao Yu --- v2: - only handle FADVISE_TRUNC_BIT for first open() fs/f2fs/f2fs.h | 1 + fs/f2

Re: [f2fs-dev] [PATCH v2] f2fs: fix to avoid use SSR allocate when do defragment

2024-05-29 Thread Chao Yu
1 552960 3681807 3681807 1 557056 3681809 3681809 1 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] f2fs: fix to cover read extent cache access with lock

2024-05-29 Thread Chao Yu
433e9dc6...@syzkaller.appspotmail.com Closes: https://lore.kernel.org/linux-f2fs-devel/09beea061740a...@google.com Signed-off-by: Chao Yu --- fs/f2fs/extent_cache.c | 48 +- fs/f2fs/f2fs.h | 2 +- fs/f2fs/inode.c| 10 - 3 files cha

Re: [f2fs-dev] [PATCH] f2fs: fix to avoid use SSR allocate when do defragment

2024-05-29 Thread Chao Yu
On 2024/5/29 16:19, Zhiguo Niu wrote: SSR allocate mode will be used when doing file defragment if ATGC is working at the same time, that is because set_page_private_gcing may make CURSEG_ALL_DATA_ATGC segment type got in f2fs_allocate_data_block when defragment page is writeback, which may cause

Re: [f2fs-dev] [PATCH] f2fs: fix to remove redundant SBI_NEED_FSCK flag set

2024-05-28 Thread Chao Yu
On 2024/5/27 19:12, Zhiguo Niu wrote: Subsequent f2fs_stop_checkpoint will set cp_err, so this SBI_NEED_FSCK flag set action is invalid. Signed-off-by: Zhiguo Niu Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel

Re: [f2fs-dev] [PATCH v4 2/2] dump.f2fs: Fix xattr dumping

2024-05-28 Thread Chao Yu
On 2024/5/24 6:47, Daniel Rosenberg wrote: Xattrs for files with inline data were being skipped. This dumps those, as well as xattrs for folders. Signed-off-by: Daniel Rosenberg Reviewed-by: Daeho Jeong Reviewed-by: Chao Yu Thanks, ___ Linux

Re: [f2fs-dev] [PATCH v4 1/2] dump.f2fs: Add ability to dump folders

2024-05-28 Thread Chao Yu
On 2024/5/24 6:46, Daniel Rosenberg wrote: This adds the ability to dump folders as well as files. Folders are dumped recursively. Additionally, dumped files/folders may be directed to a folder specified by -o [path] instead of ./lost_found. The -r flag will dump the entire fs from the root inode

Re: [f2fs-dev] [PATCH] f2fs: enable atgc if atgc_age_threshold from user is less than elapsed_time

2024-05-28 Thread Chao Yu
On 2024/5/20 19:36, Zhiguo Niu wrote: Now atgc can be enabled based on the following conditions: -ATGC mount option is set -elapsed_time is more than atgc_age_threshold already but these conditions are check when umounted->mounted device again. If the device has not be umounted->mounted for a lon

[f2fs-dev] [PATCH] f2fs_io: fix output of do_read()

2024-05-23 Thread Chao Yu
-by: Chao Yu --- tools/f2fs_io/f2fs_io.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/f2fs_io/f2fs_io.c b/tools/f2fs_io/f2fs_io.c index a7b593a..79b4d04 100644 --- a/tools/f2fs_io/f2fs_io.c +++ b/tools/f2fs_io/f2fs_io.c @@ -867,8 +867,15 @@ static void do_read(

[f2fs-dev] [PATCH] f2fs: fix to force buffered IO on inline_data inode

2024-05-23 Thread Chao Yu
a little bit complicated when handling race case in between direct IO and buffered IO. So, let's force to use buffered IO to fix this issue. Cc: sta...@vger.kernel.org Reported-by: Barry Song Signed-off-by: Chao Yu --- fs/f2fs/file.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/

[f2fs-dev] [PATCH 2/2] f2fs: fix to do sanity check on blocks for inline_data inode

2024-05-20 Thread Chao Yu
inode can be fuzzed, so it can has F2FS_INLINE_DATA flag and valid i_blocks/i_nid value, this patch supports to do extra sanity check to detect such corrupted state. Signed-off-by: Chao Yu --- fs/f2fs/f2fs.h | 2 +- fs/f2fs/inline.c | 20 +++- fs/f2fs/inode.c | 2 +- 3

[f2fs-dev] [PATCH 1/2] f2fs: fix to do sanity check on F2FS_INLINE_DATA flag in inode during GC

2024-05-20 Thread Chao Yu
block for fixing. Reported-by: syzbot+848062ba19c8782ca...@syzkaller.appspotmail.com Closes: https://lore.kernel.org/linux-f2fs-devel/d103ce06174d7...@google.com Signed-off-by: Chao Yu --- fs/f2fs/gc.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/fs/f2fs/gc.c b/fs

[f2fs-dev] [PATCH] f2fs: fix to truncate preallocated blocks in f2fs_file_open()

2024-05-19 Thread Chao Yu
t;f2fs: do not expose unwritten blocks to user by DIO") Reported-by: chenyuwen Closes: https://lore.kernel.org/linux-kernel/20240517085327.1188515-1-yuwen.c...@xjmz.com Signed-off-by: Chao Yu --- fs/f2fs/file.c | 28 +++- fs/f2fs/inode.c | 8 2 files changed

Re: [f2fs-dev] [PATCH] f2fs: fix to check return value of f2fs_allocate_new_section

2024-05-19 Thread Chao Yu
On 2024/5/17 19:26, Zhiguo Niu wrote: commit 245930617c9b ("f2fs: fix to handle error paths of {new,change}_curseg()") missed this allocated path, fix it. Signed-off-by: Zhiguo Niu Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel ma

Re: [f2fs-dev] 答复: [External Mail][PATCH] f2fs: fix panic in f2fs_put_super

2024-05-16 Thread Chao Yu
On 2024/5/16 18:15, 孙士杰 wrote: I didn't get it, if there is no cp_err, f2fs_write_checkpoint() in f2fs_put_super() will flush all dirty pages of node_inode, if there is cp_err, below flow will keep all dirty pages being truncated, and there is sanity check on all types of dirty pages. ===》 I und

Re: [f2fs-dev] [PATCH] f2fs: fix panic in f2fs_put_super

2024-05-16 Thread Chao Yu
On 2024/5/16 16:55, sunshijie wrote: When thread A calls kill_f2fs_super, Thread A first executes the code sbi->node_inode = NULL; Then thread A may submit a bio to the function iput(sbi->meta_inode); Then thread A enters the process D state, Now that the bio submitted by thread A is complete, i

Re: [f2fs-dev] [PATCH] f2fs:modify the entering condition for f2fs_migrate_blocks()

2024-05-16 Thread Chao Yu
On 2024/5/15 16:24, Liao Yuanhong wrote: Currently, when we allocating a swap file on zone UFS, this file will created on conventional UFS. If the swap file size is not aligned with the zone size, the last extent will enter f2fs_migrate_blocks(), resulting in significant additional I/O overhead a

[f2fs-dev] [PATCH] f2fs: add support for FS_IOC_GETFSSYSFSPATH

2024-05-15 Thread Chao Yu
FS_IOC_GETFSSYSFSPATH ioctl expects sysfs sub-path of a filesystem, the format can be "$FSTYP/$SYSFS_IDENTIFIER" under /sys/fs, it can helps to standardizes exporting sysfs datas across filesystems. This patch wires up FS_IOC_GETFSSYSFSPATH for f2fs, it will output "f2fs/".

Re: [f2fs-dev] [PATCH v2] f2fs: fix to avoid racing in between read and OPU dio write

2024-05-14 Thread Chao Yu
On 2024/5/15 12:42, Jaegeuk Kim wrote: On 05/15, Chao Yu wrote: On 2024/5/15 0:09, Jaegeuk Kim wrote: On 05/10, Chao Yu wrote: If lfs mode is on, buffered read may race w/ OPU dio write as below, it may cause buffered read hits unwritten data unexpectly, and for dio read, the race condition

Re: [f2fs-dev] [PATCH 3/3] f2fs: fix to do sanity check on i_nid for inline_data inode

2024-05-14 Thread Chao Yu
On 2024/5/15 12:39, Jaegeuk Kim wrote: On 05/15, Chao Yu wrote: On 2024/5/15 0:07, Jaegeuk Kim wrote: 外部邮件/External Mail On 05/11, Chao Yu wrote: On 2024/5/11 8:38, Jaegeuk Kim wrote: On 05/10, Chao Yu wrote: On 2024/5/10 11:36, Jaegeuk Kim wrote: On 05/10, Chao Yu wrote: On 2024/5/9 23

Re: [f2fs-dev] [PATCH] f2fs: Add inline to f2fs_build_fault_attr() stub

2024-05-14 Thread Chao Yu
on. Fixes: 4ed886b187f4 ("f2fs: check validation of fault attrs in f2fs_build_fault_attr()") Signed-off-by: Nathan Chancellor Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.s

Re: [f2fs-dev] [PATCH] f2fs: initialize last_block_in_bio variable

2024-05-14 Thread Chao Yu
On 2024/5/14 19:35, Wu Bo wrote: Initialize last_block_in_bio of struct f2fs_bio_info and clean up code. Signed-off-by: Wu Bo Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https

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