Re: [f2fs-dev] circular locking dependency warning in f2fs

2023-08-20 Thread Chao Yu
-0700, Eric Biggers wrote: On Thu, Aug 17, 2023 at 10:26:12PM +0800, Chao Yu wrote: lock(new_inode#2->i_sem) lock(dir->i_xattr_sem) lock(new_inode#1->i_sem) This looks fine to me.

Re: [f2fs-dev] [PATCH] f2fs: avoid false alarm of circular locking

2023-08-20 Thread Chao Yu
-- rlock(>i_xattr_sem); lock(>i_sem); lock(>i_xattr_sem); lock(>i_sem); Reported-and-tested-by: syzbot+e5600587fa9cbf8e3...@syzkaller.appspotmail.com Fixes: 5eda1ad1aaff "f2fs: fix deadlock in i_xattr_sem and inode page lock" Signed-off-by

Re: [f2fs-dev] [PATCH 1/2] f2fs: doc: fix description of max_small_discards

2023-08-17 Thread Chao Yu
Ping, On 2023/7/30 22:25, Chao Yu wrote: The description of max_small_discards is out-of-update in below two aspects, fix it. - it is disabled by default - small discards will be issued during checkpoint Signed-off-by: Chao Yu --- Documentation/ABI/testing/sysfs-fs-f2fs | 6 +++--- 1 file

Re: [f2fs-dev] [PATCH] f2fs_io: add do_clearflags to clear nocompress/compress flag

2023-08-17 Thread Chao Yu
On 2023/8/15 19:19, Qi Han wrote: To align f2fs_io functionality with chattr +/-c and +/-m, the do_clearflags function has been added to clear the FS_COMPR_FL and FS_NOCOMP_FL flags. Signed-off-by: Qi Han --- man/f2fs_io.8 | 4 tools/f2fs_io/f2fs_io.c | 37

Re: [f2fs-dev] [PATCH] f2fs-tools: f2fs_io: no memcpy for mmap read

2023-08-17 Thread Chao Yu
On 2023/8/15 4:58, Jaegeuk Kim wrote: This replaces the mmmap read flow to get the maximum performance. Signed-off-by: Jaegeuk Kim Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https

Re: [f2fs-dev] circular locking dependency warning in f2fs

2023-08-17 Thread Chao Yu
On 2023/8/17 11:52, Jaegeuk Kim wrote: On Wed, Aug 16, 2023 at 7:11 PM Guenter Roeck wrote: On Wed, Aug 16, 2023 at 10:25:06AM -0700, Jaegeuk Kim wrote: Hi, On Tue, Aug 15, 2023 at 10:09 PM Guenter Roeck wrote: Hi, when trying to boot from an f2fs file system with lock debugging

Re: [f2fs-dev] [PATCH] f2fs: should update REQ_TIME for direct write

2023-08-12 Thread Chao Yu
On 2023/8/10 16:40, Zhiguo Niu wrote: The sending interval of discard and GC should also consider direct write requests; filesystem is not idle if there is direct write. Signed-off-by: Zhiguo Niu Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs

[f2fs-dev] [PATCH 2/2] f2fs: fix to account cp stats correctly

2023-08-07 Thread Chao Yu
cp_foreground_calls sysfs entry shows total CP call count rather than foreground CP call count, fix it. Fixes: fc7100ea2a52 ("f2fs: Add f2fs stats to sysfs") Signed-off-by: Chao Yu --- fs/f2fs/checkpoint.c | 2 +- fs/f2fs/debug.c | 9 - fs/f2fs/f2fs.h

[f2fs-dev] [PATCH 1/2] f2fs: fix to account gc stats correctly

2023-08-07 Thread Chao Yu
- support to account migrated section count if it enables large section mode - fix to show correct value in gc_foreground_calls sysfs entry Fixes: fc7100ea2a52 ("f2fs: Add f2fs stats to sysfs") Signed-off-by: Chao Yu --- fs/f2fs/debug.c | 24 ++-- fs/f2fs/f2fs

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

2023-08-07 Thread Chao Yu
On 2023/8/8 3:55, Jaegeuk Kim wrote: On 08/07, Chao Yu wrote: On 2023/8/5 4:52, Jaegeuk Kim wrote: On 07/25, Chao Yu wrote: On 2023/7/22 4:23, Jaegeuk Kim wrote: On 07/13, Chao Yu wrote: On 2023/7/12 23:55, Jaegeuk Kim wrote: On 07/12, Chao Yu wrote: On 2023/7/12 0:37, Jaegeuk Kim wrote

Re: [f2fs-dev] [PATCH] Revert "f2fs: clean up w/ sbi->log_sectors_per_block"

2023-08-07 Thread Chao Yu
e.kernel.org/linux-f2fs-devel/20230804091556.2372567-1-shinichiro.kawas...@wdc.com/ Cc: sta...@vger.kernel.org Reported-by: Shinichiro Kawasaki Fixes: bfd476623999 ("f2fs: clean up w/ sbi->log_sectors_per_block") Signed-off-by: Jaegeuk Kim Reviewed-by: Chao Yu Thanks, __

Re: [f2fs-dev] [PATCH] f2fs: check zone type before sending async reset zone command

2023-08-06 Thread Chao Yu
rd operation in same manner as non-zoned, regular block devices. For that purpose, add a new helper function f2fs_bdev_index() which gets index of the zone reset target device. Fixes: 25f9080576b9 ("f2fs: add async reset zone command support") Signed-off-by: Shin'ichiro Kawasaki

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

2023-08-06 Thread Chao Yu
On 2023/8/5 4:52, Jaegeuk Kim wrote: On 07/25, Chao Yu wrote: On 2023/7/22 4:23, Jaegeuk Kim wrote: On 07/13, Chao Yu wrote: On 2023/7/12 23:55, Jaegeuk Kim wrote: On 07/12, Chao Yu wrote: On 2023/7/12 0:37, Jaegeuk Kim wrote: On 07/06, Chao Yu wrote: On 2023/7/6 1:30, Jaegeuk Kim wrote

Re: [f2fs-dev] [PATCH] f2fs: clean up w/ sbi->log_sectors_per_block

2023-08-06 Thread Chao Yu
On 2023/8/5 3:21, Jaegeuk Kim wrote: On 08/04, Shinichiro Kawasaki wrote: On May 23, 2023 / 20:35, Chao Yu wrote: Use sbi->log_sectors_per_block to clean up below calculated one: unsigned int log_sectors_per_block = sbi->log_blocksize - SECTOR_SHIFT; Hello Chao, When I ran wor

Re: [f2fs-dev] [PATCH] f2fs: clean up w/ sbi->log_sectors_per_block

2023-08-06 Thread Chao Yu
On 2023/8/4 17:43, Shinichiro Kawasaki wrote: On May 23, 2023 / 20:35, Chao Yu wrote: Use sbi->log_sectors_per_block to clean up below calculated one: unsigned int log_sectors_per_block = sbi->log_blocksize - SECTOR_SHIFT; Hello Chao, When I ran workloads on f2fs using v6.5-rcX with

Re: [f2fs-dev] [PATCH 1/1] f2fs: move fiemap to use iomap framework

2023-08-05 Thread Chao Yu
On 2023/7/31 9:26, Wu Bo wrote: This patch has been tested with xfstests by running 'kvm-xfstests -c f2fs -g auto' with and without this patch; no regressions were seen. Some tests fail both before and after, and the test results are: f2fs/default: 683 tests, 9 failures, 226 skipped, 30297

Re: [f2fs-dev] [PATCH v2] f2fs: Only lfs mode is allowed with zoned block device feature

2023-08-03 Thread Chao Yu
On 2023/8/3 22:28, Chunhai Guo wrote: Now f2fs support four block allocation modes: lfs, adaptive, fragment:segment, fragment:block. Only lfs mode is allowed with zoned block device feature. Fixes: 6691d940b0e0 ("f2fs: introduce fragment allocation mode mount option") Otherwise, it looks

Re: [f2fs-dev] [PATCH] f2fs: Only lfs mode is allowed with zoned block device feature

2023-08-02 Thread Chao Yu
On 2023/6/20 22:10, Chunhai Guo wrote: Now f2fs support four block allocation modes: lfs, adaptive, fragment:segment, fragment:block. Only lfs mode is allowed with zoned block device feature. Signed-off-by: Chunhai Guo --- fs/f2fs/super.c | 12 +++- 1 file changed, 7 insertions(+),

Re: [f2fs-dev] [PATCH v2] f2fs: introduce two helper functions for the largest cached extent

2023-08-02 Thread Chao Yu
On 2023/7/26 14:16, Chao Liu wrote: On 7月 26 09:24, Chao Yu wrote: On 2023/7/25 9:36, Chao Liu wrote: From: Chao Liu This patch is a cleanup: 1. Merge __drop_largest_extent() since it has only one caller. 2. Introduce __unlock_tree_with_checking_largest() and __drop_largest_extent

[f2fs-dev] [PATCH 1/2] f2fs: doc: fix description of max_small_discards

2023-07-30 Thread Chao Yu
The description of max_small_discards is out-of-update in below two aspects, fix it. - it is disabled by default - small discards will be issued during checkpoint Signed-off-by: Chao Yu --- Documentation/ABI/testing/sysfs-fs-f2fs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff

[f2fs-dev] [PATCH 2/2] Revert "f2fs: do not issue small discard commands during checkpoint"

2023-07-30 Thread Chao Yu
. Discard pend list(Show diacrd_cmd count on each entry, .:not exist): 0 . . . . . . . . This patch reverts commit 9ac00e7cef10 ("f2fs: do not issue small discard commands during checkpoint") in order to fix this issue. Fixes: 9ac00e7cef10 ("f2fs: do not issue small discard command

Re: [f2fs-dev] [PATCH v2] f2fs: introduce two helper functions for the largest cached extent

2023-07-25 Thread Chao Yu
-by: Chao Liu --- v2: Make sure et->largest_updated gets updated within >lock. Thanks to Chao Yu for pointing out. --- fs/f2fs/extent_cache.c | 66 -- fs/f2fs/f2fs.h | 4 +-- 2 files changed, 33 insertions(+), 37 deletions(-) diff

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

2023-07-25 Thread Chao Yu
On 2023/7/22 4:23, Jaegeuk Kim wrote: On 07/13, Chao Yu wrote: On 2023/7/12 23:55, Jaegeuk Kim wrote: On 07/12, Chao Yu wrote: On 2023/7/12 0:37, Jaegeuk Kim wrote: On 07/06, 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

Re: [f2fs-dev] [PATCH] f2fs: introduce two helper functions for the largest cached extent

2023-07-22 Thread Chao Yu
On 2023/7/18 16:33, Chao Liu wrote: From: Chao Liu This patch is a cleanup: 1. Merge __drop_largest_extent() since it has only one caller. 2. Introduce __notify_largest_extent_updated() and __drop_largest_extent() to help manage largest and largest_update in extent_tree.

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

2023-07-20 Thread Chao Yu
/0x3c0 fs/namespace.c:3861 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The issue was bisected to: commit d48a7b3a72f121655d95b5157c32c7d555e44c05 Author: Chao Yu Date: Mon Jan 9 03:49:20 2023

[f2fs-dev] [PATCH 2/2] f2fs: remove unneeded check condition in __f2fs_setxattr()

2023-07-19 Thread Chao Yu
It has checked return value of write_all_xattrs(), remove unneeded following check condition. Signed-off-by: Chao Yu --- fs/f2fs/xattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/xattr.c b/fs/f2fs/xattr.c index 71bfa2391ab4..9cc1ca75b2da 100644 --- a/fs/f2fs

[f2fs-dev] [PATCH 1/2] f2fs: fix to update i_ctime in __f2fs_setxattr()

2023-07-19 Thread Chao Yu
}xattr, fix it. Signed-off-by: Chao Yu --- fs/f2fs/xattr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/xattr.c b/fs/f2fs/xattr.c index 476b186b90a6..71bfa2391ab4 100644 --- a/fs/f2fs/xattr.c +++ b/fs/f2fs/xattr.c @@ -757,17 +757,17 @@ static int __f2fs_setxattr

[f2fs-dev] [PATCH] dump.f2fs: remove redundant check condition in dump_node()

2023-07-19 Thread Chao Yu
In dump_node(), f2fs_is_valid_blkaddr() has checked ni.blk_addr's validity and dump_node() will bail up if ni.blk_addr is invalid, so let's remove redundant check condition and print below: if (ni.blk_addr == 0x0) MSG(force, "Invalid nat entry\n\n"); Signed-of

[f2fs-dev] [PATCH] f2fs-tools: do sanity check on xattr entry

2023-07-17 Thread Chao Yu
ndary") 688078e7f36c ("f2fs: fix to avoid memory leakage in f2fs_listxattr") Signed-off-by: Chao Yu --- fsck/dump.c | 9 + fsck/mount.c | 18 ++ fsck/xattr.c | 21 ++--- fsck/xattr.h | 6 ++ 4 files changed, 47 insertions(+), 7 deletions(-

[f2fs-dev] [PATCH] dump.f2fs: support to dump fsverity xattr info in print_xattr_entry()

2023-07-17 Thread Chao Yu
This patch adds to support dumping fsverity xattr info in print_xattr_entry(). Signed-off-by: Chao Yu --- fsck/mount.c | 13 + fsck/xattr.h | 11 +++ 2 files changed, 24 insertions(+) diff --git a/fsck/mount.c b/fsck/mount.c index dbb516b..2691b2f 100644 --- a/fsck/mount.c

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

2023-07-17 Thread Chao Yu
Comments? On 2023/7/13 9:31, Chao Yu wrote: On 2023/7/12 23:55, Jaegeuk Kim wrote: On 07/12, Chao Yu wrote: On 2023/7/12 0:37, Jaegeuk Kim wrote: On 07/06, 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

Re: [f2fs-dev] [PATCH] f2fs-tools: quick fix for Android build

2023-07-17 Thread Chao Yu
] raw_node->i.i_current_depth = cpu_to_le32(S_ISDIR(mode) ? 1 : 0); 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/listi

Re: [f2fs-dev] [PATCH v1] f2fs: increase usage of folio_next_index() helper

2023-07-17 Thread Chao Yu
On 2023/7/17 15:11, Minjie Du wrote: Simplify code pattern of 'folio->index + folio_nr_pages(folio)' by using the existing helper folio_next_index(). Signed-off-by: Minjie Du Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Li

Re: [f2fs-dev] [PATCH v6] f2fs-tools: support to show fscrypt_context_v2 in print_xattr_entry

2023-07-17 Thread Chao Yu
On 2023/7/17 18:52, Weichao Guo wrote: As the fscrypt context has two versions now, this patch adds the support of fscrypt_context_v2 for print_xattr_entry. Signed-off-by: Weichao Guo Signed-off-by: Sheng Yong Reviewed-by: Chao Yu Thanks

Re: [f2fs-dev] [PATCH] f2fs: don't reopen the main block device in f2fs_scan_devices

2023-07-17 Thread Chao Yu
pen, which now leads to a warning as the core super.c holder ops aren't passed in for the reopen. Fixes: 3c62be17d4f5 ("f2fs: support multiple devices") Fixes: 0718afd47f70 ("block: introduce holder ops") Signed-off-by: Christoph Hellwig Review

Re: [f2fs-dev] [PATCH v4] f2fs-tools: support to show fscrypt_context_v2 in print_xattr_entry

2023-07-17 Thread Chao Yu
On 2023/7/17 9:40, Chao Yu wrote: If I understand Eric's commnets correctly, if size == 0, we'd better just return in order to avoid below codes which may access out-of-boundary on xattr entry. Oh, wrong comment, please ignore it. Thanks

Re: [f2fs-dev] [PATCH v4] f2fs-tools: support to show fscrypt_context_v2 in print_xattr_entry

2023-07-16 Thread Chao Yu
On 2023/7/15 14:09, Weichao Guo wrote: As the fscrypt context has two versions now, this patch adds the support of fscrypt_context_v2 for print_xattr_entry. Signed-off-by: Weichao Guo Signed-off-by: Sheng Yong --- fsck/mount.c | 48 ++

Re: [f2fs-dev] [PATCH v4] f2fs-tools: support to show fscrypt_context_v2 in print_xattr_entry

2023-07-16 Thread Chao Yu
On 2023/7/15 14:09, Weichao Guo wrote: As the fscrypt context has two versions now, this patch adds the support of fscrypt_context_v2 for print_xattr_entry. Signed-off-by: Weichao Guo Signed-off-by: Sheng Yong --- fsck/mount.c | 48 ++

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

2023-07-12 Thread Chao Yu
On 2023/7/12 23:55, Jaegeuk Kim wrote: On 07/12, Chao Yu wrote: On 2023/7/12 0:37, Jaegeuk Kim wrote: On 07/06, 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

[f2fs-dev] [PATCH 2/2] f2fs: compress: don't {, de}compress non-full cluster

2023-07-12 Thread Chao Yu
f2fs won't compress non-full cluster in tail of file, let's skip dirtying and rewrite such cluster during f2fs_ioc_{,de}compress_file. Signed-off-by: Chao Yu --- fs/f2fs/file.c | 20 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs

[f2fs-dev] [PATCH 1/2] f2fs: allow f2fs_ioc_{, de}compress_file to be interrupted

2023-07-12 Thread Chao Yu
This patch allows f2fs_ioc_{,de}compress_file() to be interrupted, so that, userspace won't be blocked when manual {,de}compression on large file is interrupted by signal. Signed-off-by: Chao Yu --- fs/f2fs/file.c | 12 1 file changed, 12 insertions(+) diff --git a/fs/f2fs/file.c

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

2023-07-11 Thread Chao Yu
On 2023/7/12 0:37, Jaegeuk Kim wrote: On 07/06, 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

Re: [f2fs-dev] [PATCH] f2fs: fix spelling in ABI documentation

2023-07-11 Thread Chao Yu
fs: expose extension_list sysfs entry") Signed-off-by: Randy Dunlap Cc: Jaegeuk Kim Cc: Chao Yu Cc: linux-f2fs-devel@lists.sourceforge.net Cc: Yangtao Li Cc: Konstantin Vyshetsky Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel

Re: [f2fs-dev] [PATCH] f2fs: flush inode if atomic file is aborted

2023-07-11 Thread Chao Yu
spotmail.com Signed-off-by: Jaegeuk Kim Reviewed-by: Chao Yu Thanks, --- fs/f2fs/segment.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 0457d620011f..6e5d1039ca76 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -205,6 +2

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

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