Re: [f2fs-dev] [PATCH v2] f2fs: do not issue small discard commands during checkpoint

2023-07-11 Thread Chao Yu
On 2023/7/6 8:46, Chao Yu wrote: On 2023/7/6 1:30, Jaegeuk Kim wrote: On 07/04, Chao Yu wrote: On 2023/7/4 18:53, Jaegeuk Kim wrote: On 07/03, Chao Yu wrote: On 2023/6/15 0:10, Jaegeuk Kim wrote: If there're huge # of small discards, this will increase checkpoint latency insanely. Let's

Re: [f2fs-dev] [PATCH] f2fs: fix potential deadlock by reordering w/ i_sem

2023-07-11 Thread Chao Yu
On 2023/7/11 1:18, Jaegeuk Kim wrote: On 07/10, Chao Yu wrote: syzbot reports deadlock bug as below: -> #1 (>i_sem){+.+.}-{3:3}: down_write+0x3a/0x50 kernel/locking/rwsem.c:1573 f2fs_down_write fs/f2fs/f2fs.h:2133 [inline] f2fs_add_inline_entry+0x3a8/0x760 f

[f2fs-dev] [PATCH] f2fs: don't handle error case of f2fs_compress_alloc_page()

2023-07-10 Thread Chao Yu
f2fs_compress_alloc_page() uses mempool to allocate memory, it never fail, don't handle error case in its callers. Signed-off-by: Chao Yu --- fs/f2fs/compress.c | 14 +- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c index

[f2fs-dev] [PATCH] f2fs: fix potential deadlock by reordering w/ i_sem

2023-07-10 Thread Chao Yu
el.org/linux-f2fs-devel/000096797d06001a3...@google.com Signed-off-by: Chao Yu --- fs/f2fs/acl.c| 36 +++- fs/f2fs/acl.h| 4 ++-- fs/f2fs/dir.c| 22 -- fs/f2fs/f2fs.h | 1 - fs/f2fs/super.c | 5 ++--- f

[f2fs-dev] [PATCH v3] f2fs: fix to avoid mmap vs set_compress_option case

2023-07-05 Thread Chao Yu
by covering f2fs_file_mmap() w/ i_sem lock, meanwhile add mmap file check condition in f2fs_may_compress() as well. Fixes: e1e8debec656 ("f2fs: add F2FS_IOC_SET_COMPRESS_OPTION ioctl") Signed-off-by: Chao Yu --- v3: - fix potential deadlock. fs/f2fs/f2fs.h | 3 ++- fs/f2fs/f

Re: [f2fs-dev] [PATCH v2] f2fs: do not issue small discard commands during checkpoint

2023-07-05 Thread Chao Yu
On 2023/7/6 1:30, Jaegeuk Kim wrote: On 07/04, Chao Yu wrote: On 2023/7/4 18:53, Jaegeuk Kim wrote: On 07/03, Chao Yu wrote: On 2023/6/15 0:10, Jaegeuk Kim wrote: If there're huge # of small discards, this will increase checkpoint latency insanely. Let's issue small discards only by trim

Re: [f2fs-dev] [PATCH v2] f2fs: do not issue small discard commands during checkpoint

2023-07-04 Thread Chao Yu
On 2023/7/4 18:53, Jaegeuk Kim wrote: On 07/03, Chao Yu wrote: On 2023/6/15 0:10, Jaegeuk Kim wrote: If there're huge # of small discards, this will increase checkpoint latency insanely. Let's issue small discards only by trim. Signed-off-by: Jaegeuk Kim --- Change log from v1

Re: [f2fs-dev] [PATCH v2] f2fs: do not issue small discard commands during checkpoint

2023-07-02 Thread Chao Yu
able small_discards by default, what about below change: From eb89d9b56e817e3046d7fa17165b12416f09d456 Mon Sep 17 00:00:00 2001 From: Chao Yu Date: Mon, 3 Jul 2023 09:06:53 +0800 Subject: [PATCH] Revert "f2fs: enable small discard by default" This reverts commit d618ebaf0aa83d175658aea529

Re: [f2fs-dev] [PATCH v2] f2fs: fix deadlock in i_xattr_sem and inode page lock and fix the original issue

2023-06-30 Thread Chao Yu
On 2023/7/1 5:59, Jaegeuk Kim wrote: On 06/28, Jaegeuk Kim wrote: On 06/28, Chao Yu wrote: On 2023/6/28 16:08, Jaegeuk Kim wrote: Thread #1: [122554.641906][ T92] f2fs_getxattr+0xd4/0x5fc -> waiting for f2fs_down_read(_I(inode)->i_xattr_sem); [122554.641927][ T92] __f2fs_g

[f2fs-dev] [PATCH] fsck.f2fs: recognize ERROR_INVALID_NODE_REFERENCE

2023-06-29 Thread Chao Yu
This patch supports to recognize ERROR_INVALID_NODE_REFERENCE error recorded in superblock during fsck, and force fsck to fix related issue. Signed-off-by: Chao Yu --- fsck/mount.c | 1 + include/f2fs_fs.h | 1 + 2 files changed, 2 insertions(+) diff --git a/fsck/mount.c b/fsck/mount.c

[f2fs-dev] [PATCH] f2fs: fix to do sanity check on direct node in truncate_dnode()

2023-06-29 Thread Chao Yu
_range() instead. Reported-and-tested-by: syzbot+12cb4425b22169b52...@syzkaller.appspotmail.com Closes: https://lore.kernel.org/linux-f2fs-devel/f3038a05fef86...@google.com Signed-off-by: Chao Yu --- fs/f2fs/f2fs.h | 1 - fs/f2fs/file.c | 5 - fs/f2fs/

Re: [f2fs-dev] [PATCH v9] fsck.f2fs: Detect and fix looped node chain efficiently

2023-06-28 Thread Chao Yu
[ 35.856106] fsck.f2fs: fsck.f2fs terminated by exit(255) Suggested-by: Chao Yu Signed-off-by: Chunhai Guo Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net

Re: [f2fs-dev] [PATCH RFC] f2fs: only set release for file that has compressed data

2023-06-28 Thread Chao Yu
On 2023/6/27 20:21, Sheng Yong wrote: If a file is not comprssed yet or does not have compressed data, for example, its data has a very low compression ratio, do not set FI_COMPRESS_RELEASED flag. Signed-off-by: Sheng Yong Reviewed-by: Chao Yu Thanks

[f2fs-dev] [PATCH] f2fs: fix compile warning in f2fs_destroy_node_manager()

2023-06-28 Thread Chao Yu
nat_entry_set *setvec[SETVEC_SIZE]; Signed-off-by: Chao Yu --- fs/f2fs/node.c | 14 -- fs/f2fs/node.h | 3 +-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index dadea6b01888..3e1fa564db8f 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs

[f2fs-dev] [PATCH] f2fs: fix error path handling in truncate_dnode()

2023-06-28 Thread Chao Yu
If truncate_node() fails in truncate_dnode(), it missed to call f2fs_put_page(), fix it. Fixes: 7735730d39d7 ("f2fs: fix to propagate error from __get_meta_page()") Signed-off-by: Chao Yu --- fs/f2fs/node.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/f2f

Re: [f2fs-dev] [syzbot] [f2fs?] possible deadlock in f2fs_fiemap

2023-06-28 Thread Chao Yu
On 2023/6/26 1:45, syzbot wrote: Hello, syzbot found the following issue on: HEAD commit:15e71592dbae Add linux-next specific files for 20230621 git tree: linux-next console output: https://syzkaller.appspot.com/x/log.txt?x=101c827b28 kernel config:

Re: [f2fs-dev] [PATCH v2] f2fs: fix deadlock in i_xattr_sem and inode page lock and fix the original issue

2023-06-28 Thread Chao Yu
On 2023/6/28 16:08, Jaegeuk Kim wrote: Thread #1: [122554.641906][ T92] f2fs_getxattr+0xd4/0x5fc -> waiting for f2fs_down_read(_I(inode)->i_xattr_sem); [122554.641927][ T92] __f2fs_get_acl+0x50/0x284 [122554.641948][ T92] f2fs_init_acl+0x84/0x54c [122554.641969][ T92]

Re: [f2fs-dev] [PATCH] f2fs: remove i_xattr_sem to avoid deadlock and fix the original issue

2023-06-27 Thread Chao Yu
On 2023/6/26 21:11, Jaegeuk Kim wrote: On 06/25, Chao Yu wrote: On 2023/6/25 15:26, Chao Yu wrote: One concern below: Thread A:    Thread B: - f2fs_getxattr  - lookup_all_xattrs   - read_inline_xattr    - f2fs_get_node_page(ino)    - memcpy inline xattr

Re: [f2fs-dev] [PATCH 1/2 v2] f2fs: update mtime and ctime in move file range method

2023-06-26 Thread Chao Yu
On 2023/6/26 0:06, Yunlei He wrote: Mtime and ctime stay old value without update after move file range ioctl. This patch add time update. Signed-off-by: Yunlei He Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel

[f2fs-dev] [PATCH v2] f2fs: fix to avoid mmap vs set_compress_option case

2023-06-25 Thread Chao Yu
by covering f2fs_file_mmap() w/ i_sem lock, meanwhile add mmap file check condition in f2fs_may_compress() as well. Fixes: e1e8debec656 ("f2fs: add F2FS_IOC_SET_COMPRESS_OPTION ioctl") Signed-off-by: Chao Yu --- v2: - fix potential deadlock. fs/f2fs/f2fs.h | 3 ++- fs/f2fs/f

Re: [f2fs-dev] [PATCH] f2fs: remove i_xattr_sem to avoid deadlock and fix the original issue

2023-06-25 Thread Chao Yu
On 2023/6/25 15:26, Chao Yu wrote: One concern below: Thread A:    Thread B: - f2fs_getxattr  - lookup_all_xattrs   - read_inline_xattr    - f2fs_get_node_page(ino)    - memcpy inline xattr    - f2fs_put_page     - f2fs_setxattr

[f2fs-dev] [PATCH] fsck.f2fs: fix to call ASSERT_MSG() in is_valid_ssa_{data, node}_blk()

2023-06-25 Thread Chao Yu
fixed summary entry can be persisted correctly. Signed-off-by: Chao Yu --- fsck/fsck.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fsck/fsck.c b/fsck/fsck.c index a4db2a3..051510f 100644 --- a/fsck/fsck.c +++ b/fsck/fsck.c @@ -171,7 +171,7 @@ static int

Re: [f2fs-dev] [PATCH] f2fs: remove i_xattr_sem to avoid deadlock and fix the original issue

2023-06-25 Thread Chao Yu
On 2023/6/14 7:39, Jaegeuk Kim wrote: This reverts commit 27161f13e3c3 "f2fs: avoid race in between read xattr & write xattr". That introduced a deadlock case: Thread #1: [122554.641906][ T92] f2fs_getxattr+0xd4/0x5fc -> waiting for f2fs_down_read(_I(inode)->i_xattr_sem);

Re: [f2fs-dev] [PATCH v4] f2fs: compress tmp files given extension

2023-06-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 v8] fsck.f2fs: Detect and fix looped node chain efficiently

2023-06-22 Thread Chao Yu
On 2023/5/24 10:42, Chunhai Guo wrote: + if (!c.fix_on) { err = -1; break; } One more comment. I guess we'd better skip find_fsync_inode() and continue fsck rather than exiting directly if c.fix_on is not set,

Re: [f2fs-dev] [PATCH 2/2] f2fs: truncate pages if move file range success

2023-06-22 Thread Chao Yu
On 2023/6/23 0:16, Yunlei He wrote: If move file range success, it should remove old data from src and dst page cache. Signed-off-by: Yunlei He Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel

Re: [f2fs-dev] [PATCH 1/2 v2] f2fs: update mtime and ctime in move file range method

2023-06-22 Thread Chao Yu
On 2023/6/23 0:16, Yunlei He wrote: Mtime and ctime stay old value without update after move file range ioctl. This patch add time update. Signed-off-by: Yunlei He Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel

Re: [f2fs-dev] [PATCH v3] f2fs: compress tmp files given extension

2023-06-22 Thread Chao Yu
On 2023/6/22 15:12, Jaegeuk Kim wrote: Let's compress tmp files for the given extension list. This patch does not change the previous behavior, but allow the cases as below. Extention example: "ext" - abc.ext : allow - abc.ext.abc : allow - abc.extm : not allow Signed-off-by: Jaegeuk Kim

Re: [f2fs-dev] [PATCH 2/2] f2fs: truncate pages if move file range success

2023-06-21 Thread Chao Yu
On 2023/6/21 17:43, Yunlei He wrote: If move file range success, it should remove old data from src and dst page cache. Signed-off-by: Yunlei He Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel

Re: [f2fs-dev] [PATCH 1/2 v2] f2fs: update mtime and ctime in move file range method

2023-06-21 Thread Chao Yu
On 2023/6/21 17:43, Yunlei He wrote: Mtime and ctime stay old value without update after move file range ioctl. This patch add time update. Signed-off-by: Yunlei He --- v2: -update both src and dst inode fs/f2fs/file.c | 14 ++ 1 file changed, 14 insertions(+) diff --git

Re: [f2fs-dev] [PATCH v2] f2fs: compress tmp files given extension

2023-06-20 Thread Chao Yu
On 2023/6/14 6:14, Jaegeuk Kim wrote: Let's compress tmp files for the given extension list. This patch does not change the previous behavior, but allow the cases as below. Extention example: "ext" - abc.ext : allow - abc.ext.abc : allow - abc.extm : not allow Signed-off-by: Jaegeuk Kim ---

Re: [f2fs-dev] [PATCH] f2fs: remove unneeded page uptodate check/set

2023-06-20 Thread Chao Yu
On 2023/6/19 23:13, Yunlei He wrote: This patch remove unneeded page uptodate check/set in f2fs_vm_page_mkwrite, which already done in set_page_dirty. Signed-off-by: Yunlei He Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux

Re: [f2fs-dev] [PATCH] f2fs: not allowed to set file both cold and hot

2023-06-20 Thread Chao Yu
On 2023/6/20 10:42, 何云蕾(Yunlei he) wrote: On 2023/6/20 8:33, Chao Yu wrote: On 2023/6/13 16:52, Yunlei He wrote: File set both cold and hot advise bit is confusion, so return EINVAL to avoid this case. Signed-off-by: Yunlei He ---   fs/f2fs/xattr.c | 3 +++   1 file changed, 3 insertions

Re: [f2fs-dev] [PATCH] f2fs: not allowed to set file both cold and hot

2023-06-19 Thread Chao Yu
On 2023/6/13 16:52, Yunlei He wrote: File set both cold and hot advise bit is confusion, so return EINVAL to avoid this case. Signed-off-by: Yunlei He --- fs/f2fs/xattr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/f2fs/xattr.c b/fs/f2fs/xattr.c index

Re: [f2fs-dev] [PATCH v2] f2fs: fix to avoid mmap vs set_compress_option case

2023-06-19 Thread Chao Yu
On 2023/6/16 14:03, Eric Biggers wrote: Hi Chao, Eric, Thanks for the report, let me check this. Thanks, On Mon, May 29, 2023 at 06:47:09PM +0800, Chao Yu wrote: Compression option in inode should not be changed after they have been used, however, it may happen in below race case

Re: [f2fs-dev] [PATCH] f2fs: compress: don't force buffered io when in COMPR_MODE_USER mode

2023-06-19 Thread Chao Yu
On 2023/6/19 17:31, Yangtao Li wrote: On 2023/6/19 12:04, Chao Yu wrote: On 2023/6/19 11:11, Yangtao Li wrote: On 2023/6/19 8:54, Chao Yu wrote: On 2023/6/13 12:14, Yangtao Li wrote: On 2023/6/12 22:38, Chao Yu wrote: On 2023/6/9 21:15, Yangtao Li wrote: It is observed that when in user

Re: [f2fs-dev] [PATCH v6] f2fs: support FAULT_LOCK type fault injection

2023-06-19 Thread Chao Yu
> /sys/fs/f2fs//inject_type or b) mount -o fault_type=524288 Reported-by: kernel test robot Link: https://lore.kernel.org/oe-kbuild-all/202304031801.hgbhuubp-...@intel.com/ Suggested-by: Chao Yu Signed-off-by: Yangtao Li --- v6: -rebase Documentation/ABI/testing/sysfs-fs-f2fs |

Re: [f2fs-dev] [PATCH] f2fs: no need test opt for f2fs_issue_flush

2023-06-18 Thread Chao Yu
On 2023/4/26 0:58, Yangtao Li wrote: This information can now be obtained from the mount, and there isi no need to print it out every time the trace event is triggered. It makes sense. Jaegeuk, is it intentional to print mount option in f2fs_issue_flush tracepoint? Thanks,

Re: [f2fs-dev] [PATCH 2/2] f2fs: convert to use sbi directly

2023-06-18 Thread Chao Yu
On 2023/6/13 15:51, Yangtao Li wrote: F2FS_I_SB(inode) is redundant. 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

Re: [f2fs-dev] [PATCH] f2fs: compress: don't force buffered io when in COMPR_MODE_USER mode

2023-06-18 Thread Chao Yu
On 2023/6/19 11:11, Yangtao Li wrote: On 2023/6/19 8:54, Chao Yu wrote: On 2023/6/13 12:14, Yangtao Li wrote: On 2023/6/12 22:38, Chao Yu wrote: On 2023/6/9 21:15, Yangtao Li wrote: It is observed that when in user compression mode (compress_extension=*), even though the file

Re: [f2fs-dev] [PATCH v4] f2fs: refactor struct f2fs_attr macro

2023-06-18 Thread Chao Yu
.wjay3iym-...@intel.com/ 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 v2] f2fs: enable nowait async buffered writes

2023-06-18 Thread Chao Yu
Signed-off-by: Lu Hongfei Signed-off-by: Yangtao Li Jaegeuk, it may be late, feel free to add: Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs

Re: [f2fs-dev] [PATCH v3] f2fs_io: expend fallocate command

2023-06-18 Thread Chao Yu
On 2023/6/13 14:59, Yangtao Li wrote: Expend fallocate command to support more flags. 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

Re: [f2fs-dev] [PATCH] f2fs: count mmap write io more accurately

2023-06-18 Thread Chao Yu
On 2023/6/13 14:51, Yunlei He wrote: This patch count mmap write io more accurately and remove redundant PageUptodate judgement in f2fs_vm_page_mkwrite. Yunlei, What about separating this patch: - remove unneeded uptodate check/set. - fix incorrect PageMappedToDisk check and goto logic.

Re: [f2fs-dev] [PATCH] f2fs: compress: don't force buffered io when in COMPR_MODE_USER mode

2023-06-18 Thread Chao Yu
On 2023/6/13 12:14, Yangtao Li wrote: On 2023/6/12 22:38, Chao Yu wrote: On 2023/6/9 21:15, Yangtao Li wrote: It is observed that when in user compression mode (compress_extension=*), even though the file is not compressed, the file is still forced to use buffer io, which makes the AndroBench

Re: [f2fs-dev] [PATCH v8] fsck.f2fs: Detect and fix looped node chain efficiently

2023-06-16 Thread Chao Yu
On 2023/6/14 17:27, Chunhai Guo wrote: Hi Jaegeuk, Could you please help to confirm if this patch has been merged? I cannot see the patch in the dev-test or dev branch. Thanks. On 2023/5/24 10:42, 郭纯海 wrote: find_fsync_inode() detect the looped node chain by comparing the loop counter with

Re: [f2fs-dev] [PATCH v4 4/6] f2fs: add f2fs_ioc_get_compress_blocks

2023-06-12 Thread Chao Yu
On 2023/6/12 11:01, Sheng Yong wrote: This patch adds f2fs_ioc_get_compress_blocks() to provide a common f2fs_get_compress_blocks(). Signed-off-by: Sheng Yong Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel

Re: [f2fs-dev] [PATCH v4 3/6] f2fs: add helper to get inode chksum from inode page

2023-06-12 Thread Chao Yu
On 2023/6/12 11: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 v4 2/6] f2fs: cleanup MIN_INLINE_XATTR_SIZE

2023-06-12 Thread Chao Yu
On 2023/6/12 11: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 v4 1/6] f2fs: add helper to check compression level

2023-06-12 Thread Chao Yu
is valid. 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: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method

2023-06-12 Thread Chao Yu
or f2fs so that noop_direct_IO can eventually be removed. 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 v2] f2fs: do more sanity check on inode

2023-06-12 Thread Chao Yu
On 2023/6/13 4:16, Jaegeuk Kim wrote: On 05/31, Chao Yu wrote: There are several issues in sanity_check_inode(): - The code looks not clean, it checks extra_attr related condition dispersively. - It missed to check i_extra_isize w/ lower boundary - It missed to check feature dependency

Re: [f2fs-dev] [PATCH] f2fs: compress tmp files given extension

2023-06-12 Thread Chao Yu
On 2023/6/12 23:36, Jaegeuk Kim wrote: On 06/12, Chao Yu wrote: On 2023/6/7 4:36, Jaegeuk Kim wrote: Let's compress tmp files for the given extension list. Could you please check below commit? IIRC, it was introduce to avoid compressing file which has unpredictable tmp file, e.g. foo.sox

Re: [f2fs-dev] [PATCH] f2fs: set zstd default compression level to ZSTD_CLEVEL_DEFAULT

2023-06-12 Thread Chao Yu
On 2023/6/12 23:17, Jaegeuk Kim wrote: ZSTD does not support compress_level=0. The commit d7ffafc99c42 ("f2fs: add sanity compress level check for compressed file") started to complain this. Signed-off-by: Jaegeuk Kim Reviewed-by: Chao Y

Re: [f2fs-dev] [PATCH] f2fs: compress: don't force buffered io when in COMPR_MODE_USER mode

2023-06-12 Thread Chao Yu
On 2023/6/9 21:15, Yangtao Li wrote: It is observed that when in user compression mode (compress_extension=*), even though the file is not compressed, the file is still forced to use buffer io, which makes the AndroBench sequential read and write drop significantly. In fact, when the file is not

Re: [f2fs-dev] [PATCH] f2fs: set zstd default compression level to 3

2023-06-12 Thread Chao Yu
On 2023/6/8 0:29, Jaegeuk Kim wrote: ZSTD does not support compress_level=0. IIUC, it looks the range is [0, ZSTD_MAX_CLEVEL], 0 equals to default (ZSTD_CLEVEL_DEFAULT). zstd_compress.c /* row */ if (compressionLevel == 0) row = ZSTD_CLEVEL_DEFAULT; /* 0 == default */ else if

Re: [f2fs-dev] [PATCH] f2fs: compress tmp files given extension

2023-06-12 Thread Chao Yu
4a67d9b07ac8dce7f1034e0d887f2f4ee00fe118 Author: Chao Yu Date: Tue May 18 17:54:58 2021 +0800 f2fs: compress: fix to disallow temp extension This patch restricts to configure compress extension as format of: [filename + '.' + extension] rather than: [filename + '.' + extension

[f2fs-dev] [PATCH] f2fs-tools: fix to call assert() if f2fs_dentry_hash() fails

2023-06-08 Thread Chao Yu
f2fs_dentry_hash() may return -ENOMEM due to malloc() failure, however caller won't check validaty of return value, result assign or check wrong hash value, fix to call assert() for such case. Signed-off-by: Chao Yu --- lib/libf2fs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

Re: [f2fs-dev] [PATCH] f2fs-tools: fix wrong write pointer check for non-zoned areas

2023-06-08 Thread Chao Yu
On 2023/6/7 1:39, Daeho Jeong wrote: From: Daeho Jeong Do not check F2FS_ZONED_HM for the whole device. We need to do this for each area of devices. Signed-off-by: Daeho Jeong Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list

Re: [f2fs-dev] [PATCH] f2fs: enable nowait async buffered writes

2023-06-08 Thread Chao Yu
On 2023/6/6 19:13, Yangtao Li wrote: On 2023/6/6 14:43, Chao Yu wrote: On 2023/5/31 22:40, Yangtao Li wrote: This adds the async buffered write support to f2fs, the following is the relevant test data. Yangtao, Could you please provide detailed test command? Use fio to test

Re: [f2fs-dev] [PATCH v2] f2fs_io: expend fallocate command

2023-06-07 Thread Chao Yu
On 2023/6/7 22:56, Yangtao Li wrote: Expend fallocate command to support more flags. Signed-off-by: Yangtao Li --- tools/f2fs_io/f2fs_io.c | 39 +-- 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/tools/f2fs_io/f2fs_io.c

Re: [f2fs-dev] [PATCH] f2fs: enable nowait async buffered writes

2023-06-06 Thread Chao Yu
On 2023/5/31 22:40, Yangtao Li wrote: This adds the async buffered write support to f2fs, the following is the relevant test data. Yangtao, Could you please provide detailed test command? Thanks, iodepth | 1| 2| 4| 8| 16 | before(M/s) | 1012 | 1133 | 894 | 981 |

Re: [f2fs-dev] [PATCH] f2fs: flag as supporting buffered async reads

2023-06-06 Thread Chao Yu
, Applied with a minor motification based on yours. :) The version in dev-test branch looks good to me. Reviewed-by: Chao Yu Thanks, Match other file-systems and enable it. The read performance has been greatly improved under io_uring: 167M/s -> 234M/s, Increase ratio by 40% Test w

Re: [f2fs-dev] [PATCH v2] f2fs: fix to avoid mmap vs set_compress_option case

2023-06-06 Thread Chao Yu
Jaegeuk, Any comments on this patch? On 2023/5/29 18:47, Chao Yu wrote: Compression option in inode should not be changed after they have been used, however, it may happen in below race case: Thread AThread B - f2fs_ioc_set_compress_option - check

[f2fs-dev] [PATCH] f2fs: check return value of freeze_super()

2023-06-06 Thread Chao Yu
freeze_super() can fail, it needs to check its return value and do error handling in f2fs_resize_fs(). Fixes: 04f0b2eaa3b3 ("f2fs: ioctl for removing a range from F2FS") Fixes: b4b10061ef98 ("f2fs: refactor resize_fs to avoid meta updates in progress") Signed-off-by: Chao Y

[f2fs-dev] [PATCH] f2fs: introduce F2FS_QUOTA_DEFAULT_FL for cleanup

2023-06-06 Thread Chao Yu
This patch adds F2FS_QUOTA_DEFAULT_FL to include two default flags: F2FS_NOATIME_FL and F2FS_IMMUTABLE_FL, and use it to clean up codes. Signed-off-by: Chao Yu --- fs/f2fs/f2fs.h | 2 ++ fs/f2fs/super.c | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/f2fs.h b

Re: [f2fs-dev] [PATCH v3 1/1] f2fs: fix args passed to trace_f2fs_lookup_end

2023-06-05 Thread Chao Yu
dentry exists: err(-ENOENT) with new(ERR) --> dentry, err=ERR Signed-off-by: Wu Bo 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: remove power-of-two limitation of zoned device

2023-06-05 Thread Chao Yu
On 2023/6/1 1:52, Daeho Jeong wrote: From: Daeho Jeong Remove power-of-two limitation for zoned device, since zoned devices don't have it. Signed-off-by: Daeho Jeong Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs

Re: [f2fs-dev] [PATCH v3] fsck.f2fs: fix memleak in f2fs_create()

2023-06-05 Thread Chao Yu
On 2023/6/5 14:08, Maxim Korotkov wrote: In error handling cases, exiting a function without releasing memory Signed-off-by: Maxim Korotkov Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net

Re: [f2fs-dev] [PATCH v2] fsck.f2fs: fix potential NULL dereference

2023-06-04 Thread Chao Yu
On 2023/6/2 18:26, Maxim Korotkov wrote: The input pointer "parent" was used unsafely before checking against NULL Found by RASU JSC with Svace static analyzer Fixes: 603f8f9d3(sload.f2fs: support loading files into partition directly) Reviewed-by: Chao Yu Signed-off-by: Maxi

Re: [f2fs-dev] [PATCH v2] fsck.f2fs: fix memleak in f2fs_create()

2023-06-04 Thread Chao Yu
On 2023/6/2 18:24, Maxim Korotkov wrote: In error handling cases, the function exited without releasing memory Signed-off-by: Maxim Korotkov --- changelog: fixed code review remarks fsck/dir.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/fsck/dir.c

Re: [f2fs-dev] [PATCH v2] fsck.f2fs: fix memleak in f2fs_create()

2023-06-04 Thread Chao Yu
On 2023/6/2 18:24, Maxim Korotkov wrote: In error handling cases, the function exited without releasing memory Signed-off-by: Maxim Korotkov Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net

Re: [f2fs-dev] [PATCH] fsck.f2fs: fix memleak in f2fs_create()

2023-06-02 Thread Chao Yu
On 2023/5/31 15:22, Maxim Korotkov wrote: In error handling cases, exiting a function without releasing memory Added tags to clean up resources and return error code Found by RASU JSC Signed-off-by: Maxim Korotkov --- fsck/dir.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-)

Re: [f2fs-dev] [PATCH] fsck.f2fs: fix potential NULL dereference

2023-06-02 Thread Chao Yu
On 2023/5/31 14:51, Maxim Korotkov wrote: The input pointer "parent" was used unsafely before checking against NULL Found by RASU JSC with Svace static analyzer Fixes: 603f8f9d3(sload.f2fs: support loading files into partition directly) Signed-off-by: Maxim Korotkov --- fsck/dir.c | 14

Re: [f2fs-dev] [PATCH] f2fs: including waf data in f2fs status information

2023-06-02 Thread Chao Yu
On 2023/6/2 12:48, beomsu kim wrote: When evaluating in f2fs, it takes much time to obtain waf data. This patch helps to obtain waf data without calcluation. Signed-off-by: Beomsu Kim --- fs/f2fs/iostat.c | 16 1 file changed, 16 insertions(+) diff --git a/fs/f2fs/iostat.c

[f2fs-dev] [PATCH v2 2/2] f2fs: avoid dead loop in f2fs_issue_checkpoint()

2023-06-02 Thread Chao Yu
ive Calling filemap_fdatawrite() and filemap_fdatawait() to keep all data clean before quota file setup. Signed-off-by: Chao Yu --- v2: - avoid compile warning reported by l...@intel.com. fs/f2fs/super.c | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/supe

[f2fs-dev] [PATCH] f2fs_io: support gc_range command

2023-06-01 Thread Chao Yu
This patch supports a new sub-command 'gc_range' in f2fs_io to trigger gc to move blocks in specified range via F2FS_IOC_GARBAGE_COLLECT_RANGE ioctl. Signed-off-by: Chao Yu --- man/f2fs_io.8 | 3 +++ tools/f2fs_io/f2fs_io.c | 35 +++ 2 files changed

Re: [f2fs-dev] [PATCH 1/2] f2fs_io: add [get|set_attr] to access inode extra attributes

2023-05-31 Thread Chao Yu
On 2023/5/29 9:35, Sheng Yong wrote: This patch adds get_attr and set_attr to access inode's extra attributes. It needs to update f2fs_io(8) manual as well? Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net

Re: [f2fs-dev] [PATCH v2] f2fs: add f2fs_ioc_[get|set]_extra_attr

2023-05-31 Thread Chao Yu
-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: do more sanity check on inode

2023-05-30 Thread Chao Yu
On 2023/5/31 7:03, Jaegeuk Kim wrote: On 05/29, Chao Yu wrote: This patch does below changes: - clean up check condition - add sanity check for i_extra_isize w/ lower boundary - add sanity check for feature dependency - check i_extra_isize only if f2fs_has_extra_attr() is true Could you

[f2fs-dev] [PATCH v2] f2fs: do more sanity check on inode

2023-05-30 Thread Chao Yu
on extra_attr feature. - It's not necessary to check i_extra_isize due to it will only be assigned to non-zero value if f2fs_has_extra_attr() is true in do_read_inode(). Fix them all in this patch. Signed-off-by: Chao Yu --- v2: - describe current problem in commit message fs/f2fs/f2fs.h | 2 + fs

Re: [f2fs-dev] [PATCH v3 3/4] mkfs.f2fs: cleanup w/ alloc_next_free_block()

2023-05-30 Thread Chao Yu
On 2023/5/31 7:47, Jaegeuk Kim wrote: On 05/27, Chao Yu wrote: Introduce alloc_next_free_block() to wrap below openned codes: blkaddr = get_sb(main_blkaddr) + c.cur_seg[curseg_type] * c.blks_per_seg + c.curseg_offset[curseg_type

[f2fs-dev] [PATCH v2] fsck.f2fs: clean up codes with IS_INODE()

2023-05-30 Thread Chao Yu
and change return value's type of IS_INODE() from int to bool. Signed-off-by: Chao Yu --- v2: - remove unnecessary le32_to_cpu() - change return value's type of IS_INODE() fsck/fsck.c | 7 +++ fsck/mount.c | 4 ++-- fsck/node.h | 4 ++-- 3 files changed, 7 insertions(+), 8 deletions

Re: [f2fs-dev] [PATCH v2 1/1] f2fs: fix args passed to trace_f2fs_lookup_end

2023-05-30 Thread Chao Yu
On 2023/5/31 7:32, Jaegeuk Kim wrote: On 05/30, Wu Bo wrote: The NULL return of 'd_splice_alias' dosen't mean error. Thus the successful case will also return NULL, which makes the tracepoint always print 'err=-ENOENT'. Signed-off-by: Wu Bo --- fs/f2fs/namei.c | 5 +++-- 1 file changed, 3

Re: [f2fs-dev] [PATCH] fsck.f2fs: clean up codes with IS_INODE()

2023-05-30 Thread Chao Yu
On 2023/5/31 6:58, Jaegeuk Kim wrote: On 05/28, Chao Yu wrote: and use le32_to_cpu() in IS_INODE(). Signed-off-by: Chao Yu --- fsck/fsck.c | 7 +++ fsck/mount.c | 4 ++-- fsck/node.h | 3 ++- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fsck/fsck.c b/fsck/fsck.c

Re: [f2fs-dev] [PATCH v2 1/1] f2fs: fix args passed to trace_f2fs_lookup_end

2023-05-29 Thread Chao Yu
On 2023/5/30 9:21, Wu Bo wrote: The NULL return of 'd_splice_alias' dosen't mean error. Thus the successful case will also return NULL, which makes the tracepoint always print 'err=-ENOENT'. Signed-off-by: Wu Bo Reviewed-by: Chao Yu Thanks

Re: [f2fs-dev] [PATCH] f2fs: allows setting compress option to files which marked with FI_MMAP_FILE

2023-05-29 Thread Chao Yu
On 2023/5/24 19:41, Qi Han wrote: Allow to compress mmap files in commit e3c548323d32 ("f2fs: let's allow compression for mmap files"). However, we cannot set the compress option to the mmap file. To keep the same concept in both compress_modes, f2fs_ioc_set_compress_option should also allow it.

[f2fs-dev] [PATCH v2] f2fs: fix to avoid mmap vs set_compress_option case

2023-05-29 Thread Chao Yu
by covering f2fs_file_mmap() w/ inode lock, meanwhile add mmap file check condition in f2fs_may_compress() as well. Fixes: e1e8debec656 ("f2fs: add F2FS_IOC_SET_COMPRESS_OPTION ioctl") Signed-off-by: Chao Yu --- v2: - add mmap file check condition in f2fs_may_compress() fs/f2fs/f2fs.h | 3 ++

[f2fs-dev] [PATCH] f2fs: do more sanity check on inode

2023-05-29 Thread Chao Yu
This patch does below changes: - clean up check condition - add sanity check for i_extra_isize w/ lower boundary - add sanity check for feature dependency - check i_extra_isize only if f2fs_has_extra_attr() is true Signed-off-by: Chao Yu --- fs/f2fs/f2fs.h | 2 + fs/f2fs/inode.c | 108

[f2fs-dev] [PATCH] f2fs: fix to avoid mmap vs set_compress_option case

2023-05-29 Thread Chao Yu
by covering f2fs_file_mmap() w/ inode lock. Fixes: e1e8debec656 ("f2fs: add F2FS_IOC_SET_COMPRESS_OPTION ioctl") Signed-off-by: Chao Yu --- fs/f2fs/file.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 7b097ab2f5e4..68

Re: [f2fs-dev] [PATCH v3] f2fs: Detect looped node chain efficiently

2023-05-29 Thread Chao Yu
efficient. Signed-off-by: Chunhai Guo 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/1] f2fs: fix args passed to trace_f2fs_lookup_end

2023-05-29 Thread Chao Yu
On 2023/5/29 12:13, Wu Bo wrote: On Sat, May 27, 2023 at 09:01:41AM +0800, Chao Yu wrote: On 2023/5/27 1:21, Jaegeuk Kim wrote: On 05/24, Wu Bo wrote: The NULL return of 'd_splice_alias' dosen't mean error. Signed-off-by: Wu Bo --- fs/f2fs/namei.c | 2 +- 1 file changed, 1 insertion

[f2fs-dev] [PATCH] fsck.f2fs: clean up codes with IS_INODE()

2023-05-28 Thread Chao Yu
and use le32_to_cpu() in IS_INODE(). Signed-off-by: Chao Yu --- fsck/fsck.c | 7 +++ fsck/mount.c | 4 ++-- fsck/node.h | 3 ++- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fsck/fsck.c b/fsck/fsck.c index e6ad71d..a4db2a3 100644 --- a/fsck/fsck.c +++ b/fsck/fsck.c

[f2fs-dev] [PATCH 1/2] f2fs: fix to drop all dirty meta/node pages during umount()

2023-05-28 Thread Chao Yu
For cp error case, there will be dirty meta/node pages remained after f2fs_write_checkpoint() in f2fs_put_super(), drop them explicitly, and do sanity check on reference count of dirty pages and inflight IOs. Signed-off-by: Chao Yu --- fs/f2fs/super.c | 18 -- 1 file changed, 16

[f2fs-dev] [PATCH 2/2] f2fs: avoid dead loop in f2fs_issue_checkpoint()

2023-05-28 Thread Chao Yu
ive Calling filemap_fdatawrite() and filemap_fdatawait() to keep all data clean before quota file setup. Signed-off-by: Chao Yu --- fs/f2fs/super.c | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index d1bce753f0d2..0bfa98d05

Re: [f2fs-dev] [PATCH 1/1] f2fs: fix args passed to trace_f2fs_lookup_end

2023-05-26 Thread Chao Yu
On 2023/5/27 1:21, Jaegeuk Kim wrote: On 05/24, Wu Bo wrote: The NULL return of 'd_splice_alias' dosen't mean error. Signed-off-by: Wu Bo --- fs/f2fs/namei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index

Re: [f2fs-dev] [PATCH v2] f2fs: Detect looped node chain efficiently

2023-05-26 Thread Chao Yu
On 2023/5/26 17:08, Chunhai Guo wrote: find_fsync_dnodes() detect the looped node chain by comparing the loop counter with free blocks. While it may take tens of seconds to quit when the free blocks are large enough. We can use Floyd's cycle detection algorithm to make the detection more

Re: [f2fs-dev] [PATCH v2] f2fs: fix to set noatime and immutable flag for quota file

2023-05-26 Thread Chao Yu
On 2023/5/27 1:05, Jaegeuk Kim wrote: On 05/25, Chao Yu wrote: We should set noatime bit for quota files, since no one cares about atime of quota file, and we should set immutalbe bit as well, due to nobody should write to the file through exported interfaces. Meanwhile this patch use

[f2fs-dev] [PATCH v3] f2fs: fix to set noatime and immutable flag for quota file

2023-05-26 Thread Chao Yu
ode->i_flags update. Signed-off-by: Chao Yu --- v3: - simply check condition suggested by Jaegeuk. fs/f2fs/super.c | 9 + 1 file changed, 9 insertions(+) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 51812f459581..8eb17cc73941 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -

Re: [f2fs-dev] [PATCH 2/2] f2fs-tools: reuse feature_table in print_sb_state()

2023-05-26 Thread Chao Yu
On 2023/5/27 0:25, Jaegeuk Kim wrote: On 05/26, Chao Yu wrote: Signed-off-by: Chao Yu --- fsck/mount.c | 56 +-- include/f2fs_fs.h | 42 +-- 2 files changed, 41 insertions(+), 57 deletions(-) diff --git

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