[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 co

[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

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() to

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(+), 5

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 good

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 secon

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] 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 worklo

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: check zone type before sending async reset zone command

2023-08-06 Thread Chao Yu
discard 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 K

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 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

[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] 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

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 enabled,

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] [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 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: avoid false alarm of circular locking

2023-08-20 Thread Chao Yu
uot;f2fs: fix deadlock in i_xattr_sem and inode page lock" Signed-off-by: Jaegeuk Kim Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

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

2023-08-20 Thread Chao Yu
08:53:19AM -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

[f2fs-dev] [PATCH 2/3] f2fs: fix error path of f2fs_submit_page_read()

2023-08-21 Thread Chao Yu
In error path of f2fs_submit_page_read(), it missed to call iostat_update_and_unbind_ctx() and free bio_post_read_ctx, fix it. Signed-off-by: Chao Yu --- fs/f2fs/data.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 5d9697717353..916e317ac925 100644

[f2fs-dev] [PATCH 1/3] f2fs: clean up error handling in sanity_check_{compress_, }inode()

2023-08-21 Thread Chao Yu
In sanity_check_{compress_,}inode(), it doesn't need to set SBI_NEED_FSCK in each error case, instead, we can set the flag in do_read_inode() only once when sanity_check_inode() fails. Signed-off-by: Chao Yu --- fs/f2fs/inode.c | 23 --- 1 file changed, 4 insertions(+

[f2fs-dev] [PATCH 3/3] f2fs: compress: fix to assign compress_level for lz4 correctly

2023-08-21 Thread Chao Yu
. mount|grep f2fs /dev/vdb on /mnt/f2fs type f2fs (...,compress_algorithm=lz4:9,compress_log_size=3,...) Fixes: 00e120b5e4b5 ("f2fs: assign default compression level") Signed-off-by: Chao Yu --- fs/f2fs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs

Re: [f2fs-dev] [PATCH v5 07/45] f2fs: dynamically allocate the f2fs-shrinker

2023-08-24 Thread Chao Yu
On 2023/8/24 11:42, Qi Zheng wrote: Use new APIs to dynamically allocate the f2fs-shrinker. Signed-off-by: Qi Zheng Reviewed-by: Muchun Song CC: Jaegeuk Kim CC: Chao Yu CC: linux-f2fs-devel@lists.sourceforge.net Reviewed-by: Chao Yu Thanks

Re: [f2fs-dev] [PATCH] f2fs: fix deadlock in f2f2_add_dentry

2023-08-25 Thread Chao Yu
On 2023/8/25 13:37, Lizhi Xu wrote: There are two paths: 1. f2fs_add_dentry->f2fs_down_read->f2fs_add_inline_entry->down_write-> up_write->f2fs_up_read 2. f2fs_add_dentry->f2fs_add_regular_entry->down_write-> f2fs_init_inode_metadata->f2fs_down_read->f2fs_up_read->up_write Force order lo

Re: [f2fs-dev] [PATCH 23/29] f2fs: Convert to bdev_open_by_dev/path()

2023-08-28 Thread Chao Yu
p;id=51bf8d3c81992ae57beeaf22df78ed7c2782af9d Thanks, CC: Jaegeuk Kim CC: Chao Yu CC: linux-f2fs-devel@lists.sourceforge.net Acked-by: Christoph Hellwig Signed-off-by: Jan Kara --- fs/f2fs/f2fs.h | 1 + fs/f2fs/super.c | 17 + 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/fs/

[f2fs-dev] [PATCH 3/4] f2fs: compress: do sanity check on cluster when CONFIG_F2FS_CHECK_FS is on

2023-08-28 Thread Chao Yu
cluster, so, let's adjust f2fs_is_compressed_cluster()'s logic according to caller's requirement. Signed-off-by: Chao Yu --- fs/f2fs/compress.c | 61 ++ fs/f2fs/data.c | 4 +-- 2 files changed, 35 insertions(+), 30 deletions(-) diff

[f2fs-dev] [PATCH 1/4] f2fs: compress: fix deadloop in f2fs_write_cache_pages()

2023-08-28 Thread Chao Yu
array dynamically. Fixes: 4c8ff7095bef ("f2fs: support data compression") Signed-off-by: Chao Yu --- fs/f2fs/data.c | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 916e317ac925..3f33e14dc7f8 100644 --- a/

[f2fs-dev] [PATCH 2/4] f2fs: compress: fix to avoid use-after-free on dic

2023-08-28 Thread Chao Yu
than continuing it, in order to avoid accessing invalid dic pointer. Fixes: 6ce19aff0b8c ("f2fs: compress: add compress_inode to cache compressed blocks") Signed-off-by: Chao Yu --- fs/f2fs/data.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/data.c b

[f2fs-dev] [PATCH 4/4] f2fs: compress: fix to avoid redundant compress extension

2023-08-28 Thread Chao Yu
/mnt/f2fs 3. mount|grep f2fs /dev/vdb on /mnt/f2fs type f2fs (...,compress_extension=so,compress_extension=so,...) Fixes: 4c8ff7095bef ("f2fs: support data compression") Fixes: 151b1982be5d ("f2fs: compress: add nocompress extensions support") Signed-off-by: Chao Yu

Re: [f2fs-dev] [PATCH] f2fs: replace blk_finish_plug() with blk_flush_plug()

2023-08-30 Thread Chao Yu
On 2023/8/30 11:52, Chunhai Guo wrote: The commit 344150999b7f ("f2fs: fix to avoid potential deadlock") only requires unplugging current->plug. Using blk_finish_plug() is unnecessary as it sets current->plug as NULL and prevents wb_writeback() from using plug in subsequent loops. Instead, use bl

Re: [f2fs-dev] [PATCH v2] f2fs: replace blk_finish_plug() with blk_flush_plug()

2023-08-31 Thread Chao Yu
ps. Instead, use blk_flush_plug() as a replacement. 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 v2] f2fs: replace blk_finish_plug() with blk_flush_plug()

2023-09-04 Thread Chao Yu
On 2023/8/31 15:10, Chunhai Guo wrote: The commit 344150999b7f ("f2fs: fix to avoid potential deadlock") only requires unplugging current->plug. Using blk_finish_plug() is unnecessary as it sets current->plug as NULL and prevents wb_writeback() from using plug in subsequent loops. Instead, use bl

[f2fs-dev] [PATCH] fsck.f2fs: use INFO_MSG() to print i_gc_failure reset info

2023-09-04 Thread Chao Yu
fsck.f2fs prints i_gc_failures reset message w/ [FIX] tags, it's not appropriate due to reset i_gc_failures is not a fix. Let's add INFO_MSG() macro to print such important non-fix message. Signed-off-by: Chao Yu --- fsck/fsck.c | 2 +- include/f2fs_fs.h | 7 +++ 2 files

[f2fs-dev] [PATCH] f2fs: compress: fix to avoid fragment w/ OPU during f2fs_ioc_compress_file()

2023-09-04 Thread Chao Yu
If file has both cold and compress flag, during f2fs_ioc_compress_file(), f2fs will trigger IPU for non-compress cluster and OPU for compress cluster, so that, data of the file may be fragmented. Fix it by always triggering OPU for IOs from user mode compression. Signed-off-by: Chao Yu --- fs

Re: [f2fs-dev] [PATCH v2] f2fs: replace blk_finish_plug() with blk_flush_plug()

2023-09-06 Thread Chao Yu
On 2023/9/5 21:42, Chunhai Guo wrote: On 2023/9/5 0:40, Jaegeuk Kim wrote: On 09/04, Chao Yu wrote: On 2023/8/31 15:10, Chunhai Guo wrote: The commit 344150999b7f ("f2fs: fix to avoid potential deadlock") only requires unplugging current->plug. Using blk_finish_plug() is unne

[f2fs-dev] [PATCH] f2fs: fix to drop meta_inode's page cache in f2fs_put_super()

2023-09-06 Thread Chao Yu
ng umount()") Reported-by: syzbot+ebd7072191e2eddd7...@syzkaller.appspotmail.com Closes: https://lore.kernel.org/linux-f2fs-devel/a14f020604a62...@google.com Signed-off-by: Chao Yu --- fs/f2fs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/su

Re: [f2fs-dev] [PATCH] f2fs: preload extent_cache for POSIX_FADV_WILLNEED

2023-09-20 Thread Chao Yu
On 2023/9/20 8:46, Jaegeuk Kim wrote: This patch tries to preload extent_cache given POSIX_FADV_WILLNEED, which is more useful for generic usecases. Suggested-by: Eric Biggers Signed-off-by: Jaegeuk Kim Reviewed-by: Chao Yu Thanks, ___ Linux

Re: [f2fs-dev] [PATCH 1/3] f2fs-tools: use 'IS_CUR_SEGNO()' to check if it is current segment

2023-09-20 Thread Chao Yu
On 2023/9/15 17:04, Wu Bo wrote: Use IS_CUR_SEGNO() here can make code more concise and readable. --- fsck/mount.c | 17 - 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/fsck/mount.c b/fsck/mount.c index df0314d..00940b8 100644 --- a/fsck/mount.c +++ b/fsck/moun

Re: [f2fs-dev] [PATCH 2/3] f2fs-tools: skip not matched segment when finding free block

2023-09-20 Thread Chao Yu
On 2023/9/15 17:04, Wu Bo wrote: If the segment type is not matched, goto next segment to save time. --- fsck/mount.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fsck/mount.c b/fsck/mount.c index 00940b8..dccaae2 100644 --- a/fsck/mount.c +++ b/fsck/mount.c @@ -2854,6 +2854,8 @@ next

Re: [f2fs-dev] [PATCH v2 1/3] f2fs-tools: use 'IS_CUR_SEGNO()' to check if it is current segment

2023-10-06 Thread Chao Yu
On 2023/9/28 17:20, Wu Bo wrote: Use IS_CUR_SEGNO() here can make code more concise and readable. It missed to add your signed-off tag here, otherwise the patch looks good to me. Thanks, --- fsck/mount.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/fsck/mo

Re: [f2fs-dev] [PATCH] f2fs-tools: do not support user-space cache

2023-10-06 Thread Chao Yu
Jeong Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Re: [f2fs-dev] [PATCH 10/29] f2fs: move f2fs_xattr_handlers and f2fs_xattr_handler_map to .rodata

2023-10-06 Thread Chao Yu
On 2023/9/30 13:00, Wedson Almeida Filho wrote: From: Wedson Almeida Filho This makes it harder for accidental or malicious changes to f2fs_xattr_handlers or f2fs_xattr_handler_map at runtime. Cc: Jaegeuk Kim Cc: Chao Yu Cc: linux-f2fs-devel@lists.sourceforge.net Signed-off-by: Wedson

Re: [f2fs-dev] [PATCH] f2fs-tools: make checked node progress correct

2023-10-06 Thread Chao Yu
On 2023/10/4 5:07, Daeho Jeong wrote: From: Daeho Jeong Let's say we have 100 nodes to be checked. With post-increment of checked_node_cnt, when we reach the last node, we cannot print out 100% progress. So, go with pre-increment. Signed-off-by: Daeho Jeong Reviewed-by: Chao Yu T

Re: [f2fs-dev] [PATCH] f2fs_io: add fadvise support

2023-10-06 Thread Chao Yu
On 2023/10/4 6:28, Jaegeuk Kim wrote: f2fs_io fadvise [advice] [offset] [length] [file] advice can be "willneed" and "sequential". Signed-off-by: Jaegeuk Kim Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing l

Re: [f2fs-dev] [PATCH] f2fs: stop iterating f2fs_map_block if hole exists

2023-10-07 Thread Chao Yu
On 2023/10/4 6:52, Jaegeuk Kim wrote: Let's avoid unnecessary f2fs_map_block calls to load extents. # f2fs_io fadvise willneed 0 4096 /data/local/tmp/test f2fs_map_blocks: dev = (254,51), ino = 85845, file offset = 386, start blkaddr = 0x34ac00, len = 0x1400, flags = 2, f2fs_map_blocks

[f2fs-dev] [PATCH] f2fs: fix to initialize map.m_pblk in f2fs_precache_extents()

2023-10-07 Thread Chao Yu
Otherwise, it may print random physical block address in tracepoint of f2fs_map_blocks() as below: f2fs_map_blocks: dev = (253,16), ino = 2297, file offset = 0, start blkaddr = 0xa356c421, len = 0x0, flags = 0 Fixes: c4020b2da4c9 ("f2fs: support F2FS_IOC_PRECACHE_EXTENTS") Signed-of

Re: [f2fs-dev] [PATCH] f2fs: avoid format-overflow warning

2023-10-07 Thread Chao Yu
ot; can up to 7, so total size is "24 + 4 + 7 = 35". slab_name's size should be 35 rather than 32. Signed-off-by: Su Hui Looks good to me, thanks for the patch. Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2

Re: [f2fs-dev] [PATCH v2] f2fs-tools: use proper address entry count for direct nodes

2023-10-09 Thread Chao Yu
On 2023/10/10 4:29, Daeho Jeong wrote: From: Daeho Jeong For direct nodes, we have to use DEF_ADDRS_PER_BLOCK. Signed-off-by: Daeho Jeong Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net

[f2fs-dev] [PATCH] f2fs: let f2fs_precache_extents() traverses in file range

2023-10-09 Thread Chao Yu
Rather than in range of [0, max_file_blocks()), since data after EOF is alwasy zero, it's unnecessary to preload mapping info of the data. Signed-off-by: Chao Yu --- fs/f2fs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c

Re: [f2fs-dev] [PATCH] f2fs: Clean up errors in segment.h

2023-10-15 Thread Chao Yu
On 2023/10/13 14:45, KaiLong Wang wrote: Fix the following errors reported by checkpatch: ERROR: spaces required around that ':' (ctx:VxW) Signed-off-by: KaiLong Wang Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list

Re: [f2fs-dev] [PATCH] f2fs-tools: initialize allocated node area

2023-10-15 Thread Chao Yu
On 2023/10/14 6:24, Daeho Jeong wrote: From: Daeho Jeong Need to initialize allocated node areas after memory allocation. Signed-off-by: Daeho Jeong --- fsck/node.c | 1 + include/f2fs_fs.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/fsck/node.c b/fsck/node.c index 376147

Re: [f2fs-dev] [PATCH] f2fs: fix error path of __f2fs_build_free_nids

2023-10-16 Thread Chao Yu
fscorrupted error flag, and in above scenario, it will persist the error flag into superblock synchronously to avoid it has no luck to trigger a checkpoint to record SBI_NEED_FSCK. Signed-off-by: Zhiguo Niu Signed-off-by: Chao Yu --- fs/f2fs/node.c | 11 +-- include/linux

Re: [f2fs-dev] [PATCH] f2fs: clean up zones when not successfully unmounted

2023-10-16 Thread Chao Yu
On 2023/10/11 3:36, Daeho Jeong wrote: From: Daeho Jeong We can't trust write pointers when the previous mount was not successfully unmounted. Signed-off-by: Daeho Jeong Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list

Re: [f2fs-dev] [PATCH] f2fs: fix error path of __f2fs_build_free_nids

2023-10-16 Thread Chao Yu
Zhiguo, On 2023/10/16 17:02, Zhiguo Niu wrote: Dear Chao, On Mon, Oct 16, 2023 at 3:37 PM Chao Yu wrote: On 2023/10/13 18:58, Zhiguo Niu wrote: SBI_NEED_FSCK should be set for fsck has a chance to repair in case of scan_nat_page fail in run time. Signed-off-by: Zhiguo Niu Hi Zhiguo

Re: [f2fs-dev] [PATCH] f2fs: fix error path of __f2fs_build_free_nids

2023-10-16 Thread Chao Yu
On 2023/10/16 17:02, Zhiguo Niu wrote: Dear Chao, On Mon, Oct 16, 2023 at 3:37 PM Chao Yu wrote: On 2023/10/13 18:58, Zhiguo Niu wrote: SBI_NEED_FSCK should be set for fsck has a chance to repair in case of scan_nat_page fail in run time. Signed-off-by: Zhiguo Niu Hi Zhiguo, Can you

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

2023-10-16 Thread Chao Yu
Teach fsck.f2fs to recognize newly introduced error type ERROR_INCONSISTENT_NAT. 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 index 9d786ea..a1389ed 100644 --- a/fsck/mount.c +++ b/fsck

Re: [f2fs-dev] [RFC] weirdness in f2fs_rename() with RENAME_WHITEOUT

2023-11-07 Thread Chao Yu
On 2023/10/27 0:16, Jan Kara wrote: Jaegeuk, Chao, any comment on this? It really looks like a filesystem corruption issue in f2fs when whiteouts are used... Sorry for delay reply, I was busy handling product issues these days... Let me check this ASAP. Thanks,

Re: [f2fs-dev] [PATCH] f2fs: use inode_lock_shared instead of inode_lock in f2fs_seek_block()

2023-11-07 Thread Chao Yu
d-off-by: zhangxirui 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 fallocate failed under pinned block situation

2023-11-07 Thread Chao Yu
On 2023/10/30 17:40, Wu Bo wrote: If GC victim has pinned block, it can't be recycled. And if GC is foreground running, after many failure try, the pinned file is expected to be clear pin flag. To enable the section be recycled. But when fallocate trigger FG_GC, GC can never recycle the pinned s

Re: [f2fs-dev] [PATCH] f2fs: fix thread name cannot be fully displayed

2023-11-07 Thread Chao Yu
On 2023/11/2 9:20, Zhiguo Niu wrote: Because the length of task'name in task_struct can not exceed 16 characters, f2fs some thread'name cannot be fully displayed, including important device number information. If there are more than one partition using the f2fs file system, it is very inconvenien

Re: [f2fs-dev] [PATCH] f2fs: the name of a struct is wrong in a comment.

2023-11-07 Thread Chao Yu
On 2023/11/4 15:45, ds...@lzu.edu.cn wrote: From: Yang Hubin The macro SUMMARY_SIZE represents the size of the struct f2fs_summary, instead of the size of the struct summary. Signed-off-by: Yang Hubin Signed-off-by: Qian Haolai Reviewed-by: Chao Yu Thanks

Re: [f2fs-dev] [PATCH] f2fs: explicitly null-terminate the xattr list

2023-11-07 Thread Chao Yu
On 2023/11/7 12:44, Eric Biggers wrote: From: Eric Biggers When setting an xattr, explicitly null-terminate the xattr list. This eliminates the fragile assumption that the unused xattr space is always zeroed. Signed-off-by: Eric Biggers Reviewed-by: Chao Yu Thanks

Re: [f2fs-dev] [PATCH] f2fs: data: fix possible overflow in check_swap_activate()

2023-11-07 Thread Chao Yu
Hi Sergey, Thanks for the patch. On 2023/10/26 4:20, Sergey Shtylyov wrote: In check_swap_activate(), if the *while* loop exits early (0- or 1-page long swap file), an overflow happens while calculating the value of the span parameter as the lowest_pblock variable ends up being greater than the

Re: [f2fs-dev] [PATCH] libf2fs: Fix using uninitialized variables error in get_device_info()

2023-11-09 Thread Chao Yu
On 2023/11/8 20:38, zangyangyang1 wrote: This issue comes from a static code scanning tool. When c.sparse_mode is 1, stat_buf will not be initialized, but it will be used next. If this issue does not require modification, please ignore this commit. Signed-off-by: zangyangyang1 --- lib/libf2fs

Re: [f2fs-dev] [PATCH V2] libf2fs: Fix using uninitialized variables error in get_device_info()

2023-11-09 Thread Chao Yu
: 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 fallocate failed under pinned block situation

2023-11-10 Thread Chao Yu
On 2023/11/8 21:48, Wu Bo wrote: On 2023/11/7 22:39, Chao Yu wrote: On 2023/10/30 17:40, Wu Bo wrote: If GC victim has pinned block, it can't be recycled. And if GC is foreground running, after many failure try, the pinned file is expected to be clear pin flag. To enable the secti

Re: [f2fs-dev] [PATCH] f2fs: skip adding a discard command if exists

2023-11-14 Thread Chao Yu
On 2023/11/15 5:24, Jaegeuk Kim wrote: When recovering zoned UFS, sometimes we add the same zone to discard multiple times. Simple workaround is to bypass adding it. What about skipping f2fs_bug_on() just for zoned UFS case? so that the check condition can still be used for non-zoned UFS case.

Re: [f2fs-dev] [PATCH] f2fs: skip adding a discard command if exists

2023-11-14 Thread Chao Yu
On 2023/11/15 10:45, Jaegeuk Kim wrote: On 11/15, Chao Yu wrote: On 2023/11/15 5:24, Jaegeuk Kim wrote: When recovering zoned UFS, sometimes we add the same zone to discard multiple times. Simple workaround is to bypass adding it. What about skipping f2fs_bug_on() just for zoned UFS case? so

Re: [f2fs-dev] [PATCH 1/2] Revert "f2fs-tools: do not support user-space cache"

2023-11-14 Thread Chao Yu
On 2023/10/17 5:58, Jaegeuk Kim wrote: This reverts commit 2835107ae3908576b41ff5f6a4e63ba7ec9a6246. There's a report that the impact was true. Signed-off-by: Jaegeuk Kim Sorry for delay reply, feel free to add: Reviewed-by: Chao Yu T

Re: [f2fs-dev] [PATCH 2/2] fsck.f2fs: fix cache offset for multiple partitions

2023-11-14 Thread Chao Yu
On 2023/10/17 5:58, Jaegeuk Kim wrote: The cache offset should have been considered multiple partitions per fd. Let's fix. Signed-off-by: Jaegeuk Kim Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-

Re: [f2fs-dev] [PATCH v2] f2fs_io: add list/setattr command

2023-11-14 Thread Chao Yu
On 2023/10/20 10:39, Jaegeuk Kim wrote: Let's add list/set/removexattrs commands. It looks it missed to add related description in man/f2fs_io.8. Thanks, Signed-off-by: Jaegeuk Kim --- - add removexattrs tools/f2fs_io/f2fs_io.c | 107 1 file

Re: [f2fs-dev] [PATCH v2] f2fs-tools: do not reuse corrupted quota inodes

2023-11-15 Thread Chao Yu
On 2023/10/27 8:21, Daeho Jeong wrote: From: Daeho Jeong When we detect quota inode corruption, we better deallocate the current space and allocate new ones for a clean start. Signed-off-by: Daeho Jeong --- v2: change node count check when creating a new node block --- fsck/fsck.c| 148

Re: [f2fs-dev] [PATCH] f2fs-tools: fix corrupted xattr entry

2023-11-15 Thread Chao Yu
On 2023/10/23 23:50, Jaegeuk Kim wrote: From: Daeho Jeong Detect and fix a corrupted xattr entry. Signed-off-by: Daeho Jeong Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https

Re: [f2fs-dev] [PATCH] f2fs-tools: ensure that unused xattr space is zeroized

2023-11-15 Thread Chao Yu
list when writing xattrs. So, the kernel relies on the unused space containing zeroes. Also, add a missing free() to fix a memory leak. Signed-off-by: Eric Biggers Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-

Re: [f2fs-dev] [PATCH] f2fs-tools: use total_node_count when creating a new node block in fsck

2023-11-15 Thread Chao Yu
On 2023/10/27 23:30, Daeho Jeong wrote: From: Daeho Jeong We might allocate more node blocks than total_valid_node_count, when we recreate quota files. Signed-off-by: Daeho Jeong Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list

Re: [f2fs-dev] [PATCH] f2fs-tools: do not put CP_UMOUNT_FLAG for roll forward recovery

2023-11-15 Thread Chao Yu
On 2023/10/27 23:49, Daeho Jeong wrote: From: Daeho Jeong If we write CP_UMOUNT_FLAG in fsck, f2fs will not do foll forward recovery :s/foll/roll Otherwise, it looks good to me. Reviewed-by: Chao Yu Thanks, even though it has to do. Signed-off-by: Daeho Jeong --- fsck/fsck.c

[f2fs-dev] [PATCH 1/3] f2fs: clean up w/ dotdot_name

2023-11-15 Thread Chao Yu
Just cleanup, no logic changes. Signed-off-by: Chao Yu --- fs/f2fs/namei.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index d0053b0284d8..a9360ee02da1 100644 --- a/fs/f2fs/namei.c +++ b/fs/f2fs/namei.c @@ -459,7 +459,6 @@ static

[f2fs-dev] [PATCH 2/3] f2fs: use shared inode lock during f2fs_fiemap()

2023-11-15 Thread Chao Yu
f2fs_fiemap() will only traverse metadata of inode, let's use shared inode lock for it to avoid unnecessary race on inode lock. Signed-off-by: Chao Yu --- fs/f2fs/data.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 4e42b5f

[f2fs-dev] [PATCH 3/3] f2fs: fix to check return value of f2fs_reserve_new_block()

2023-11-15 Thread Chao Yu
codes; Signed-off-by: Chao Yu --- fs/f2fs/recovery.c | 23 +-- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c index b56d0f1078a7..16415c770b45 100644 --- a/fs/f2fs/recovery.c +++ b/fs/f2fs/recovery.c @@ -712,7 +712,16 @@ s

Re: [f2fs-dev] [PATCH] f2fs: skip adding a discard command if exists

2023-11-19 Thread Chao Yu
On 2023/11/18 1:41, Jaegeuk Kim wrote: Not sure other cases yet.. let's do one by one, since I hit this in real. Sure. Signed-off-by: Jaegeuk Kim Reviewed-by: Chao Yu Thansk, ___ Linux-f2fs-devel mailing list Linux-f2fs-

Re: [f2fs-dev] [PATCH] f2fs-tools: adjust nat and block release logic

2023-11-19 Thread Chao Yu
On 2023/11/18 4:38, Daeho Jeong wrote: From: Daeho Jeong Fixes: 0f503e443ccb ("f2fs-tools: do not reuse corrupted quota inodes") Signed-off-by: Daeho Jeong Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-

[f2fs-dev] [PATCH] f2fs: sysfs: support discard_io_aware

2023-11-22 Thread Chao Yu
. Signed-off-by: Chao Yu --- Documentation/ABI/testing/sysfs-fs-f2fs | 6 ++ fs/f2fs/f2fs.h | 7 +++ fs/f2fs/segment.c | 6 +- fs/f2fs/sysfs.c | 9 + 4 files changed, 27 insertions(+), 1 deletion(-) diff

Re: [f2fs-dev] [PATCH 1/3] f2fs-tools: Fix debug size print

2023-11-24 Thread Chao Yu
On 2023/11/18 10:03, Daniel Rosenberg wrote: The conversion from block size to MB in this debug statement assumes a block size of 4K. This switches it to properly use the filesystem's block size. Signed-off-by: Daniel Rosenberg Reviewed-by: Chao Yu T

Re: [f2fs-dev] [PATCH 2/3] f2fs-tools: Wait for Block Size to initialize Cache

2023-11-26 Thread Chao Yu
On 2023/11/18 10:03, Daniel Rosenberg wrote: The cache is initialized during the first read, however, it requires the block size to establish its buffer. This disables the cache until the block size is known. Hi Daniel, How about this? It be more explicit to indicate the logic? --- fsck/moun

Re: [f2fs-dev] [PATCH 3/3] f2fs-tools: Fix dqb_curspace to reflect blocksize

2023-11-26 Thread Chao Yu
On 2023/11/18 10:03, Daniel Rosenberg wrote: The initial sizes for dqblk.dqb_curspace should reflect the block size, as that's the minimal filesize. Signed-off-by: Daniel Rosenberg Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing

Re: [f2fs-dev] [PATCH v1] f2fs: New victim selection for GC

2023-11-26 Thread Chao Yu
Hi Yonggil, On 2023/10/26 17:18, Yonggil Song wrote: Overview Introduce a new way to select the data section first when selecting a victim in foreground GC. This victim selection method works when the prefer_data_victim mount option is enabled. If foreground GC migrates only data secti

Re: [f2fs-dev] [PATCH 2/3] f2fs-tools: Wait for Block Size to initialize Cache

2023-11-27 Thread Chao Yu
On 2023/11/28 8:52, Daniel Rosenberg wrote: On Sun, Nov 26, 2023 at 5:42 PM Chao Yu wrote: Hi Daniel, How about this? It be more explicit to indicate the logic? --- fsck/mount.c | 2 ++ include/f2fs_fs.h | 3 +++ lib/libf2fs_io.c | 4 3 files changed, 9 insertions

Re: [f2fs-dev] [PATCH] f2fs: show more discard stat by sysfs

2023-11-27 Thread Chao Yu
On 2023/11/24 9:08, Zhiguo Niu wrote: The current pending_discard attr just only shows the discard_cmd_cnt information, which is not very meaningful. More discard information can be shown so that we can check them through sysfs when needed. What about adding this entry to /sys/fs/f2fs//stat/?

Re: [f2fs-dev] [PATCH] f2fs: add support for an i_version counter

2023-11-27 Thread Chao Yu
On 2023/11/20 17:54, Yangtao Li wrote: NFSv4 mandates a change attribute to avoid problems with timestamp granularity, which Linux implements using the i_version counter. This is particularly important when the underlying filesystem is fast. Signed-off-by: Yangtao Li --- fs/f2fs/f2fs.h | 1 +

Re: [f2fs-dev] [PATCH 1/1] f2fs: fix fallocate failed under pinned block situation

2023-11-27 Thread Chao Yu
On 2023/11/17 7:34, Wu Bo wrote: On 2023/11/11 12:49, Chao Yu wrote: On 2023/11/8 21:48, Wu Bo wrote: On 2023/11/7 22:39, Chao Yu wrote: On 2023/10/30 17:40, Wu Bo wrote: If GC victim has pinned block, it can't be recycled. And if GC is foreground running, after many failure try, the p

Re: [f2fs-dev] [PATCH v2] f2fs-tools: fixed incorrect error handling

2023-11-27 Thread Chao Yu
On 2023/11/20 15:55, Maxim Korotkov wrote: Case of failed memory allocation of dev->zone_cap_blocks doesn't release heap allocated rep Found by RASU JSC Fixes: f8410857b7a8(f2fs-tools: zns zone-capacity support) Signed-off-by: Maxim Korotkov Reviewed-by: Chao Yu

[f2fs-dev] [PATCH] f2fs: fix to avoid dirent corruption

2023-11-28 Thread Chao Yu
[Fail] Fixes: 7e01e7ad746b ("f2fs: support RENAME_WHITEOUT") Cc: Jan Kara Reported-by: Al Viro Signed-off-by: Chao Yu --- 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 3b1793cfb002..ede6afb81762 100644 --- a/

[f2fs-dev] [PATCH 1/2] f2fs: introduce tracepoint for f2fs_rename()

2023-11-28 Thread Chao Yu
This patch adds tracepoints for f2fs_rename(). Signed-off-by: Chao Yu --- fs/f2fs/namei.c | 16 ++--- include/trace/events/f2fs.h | 69 + 2 files changed, 80 insertions(+), 5 deletions(-) diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index

[f2fs-dev] [PATCH 2/2] f2fs: show i_mode in trace_f2fs_new_inode()

2023-11-28 Thread Chao Yu
This patch supports to show i_mode field in trace_f2fs_new_inode(). Signed-off-by: Chao Yu --- include/trace/events/f2fs.h | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h index 36d9e29ca3c5

Re: [f2fs-dev] [PATCH] f2fs: compress: do cleanup in f2fs_truncate_partial_cluster()

2023-12-09 Thread Chao Yu
On 2023/11/30 17:23, Yangtao Li wrote: Remove unnecessary code logic. Signed-off-by: Yangtao Li --- fs/f2fs/compress.c | 30 +- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c index 36e5dab6baae..de55c266509a

Re: [f2fs-dev] [PATCH 1/1] f2fs: fix fallocate failed under pinned block situation

2023-12-09 Thread Chao Yu
On 2023/11/28 20:51, Wu Bo wrote: On 2023/11/28 14:22, Chao Yu wrote: On 2023/11/17 7:34, Wu Bo wrote: On 2023/11/11 12:49, Chao Yu wrote: On 2023/11/8 21:48, Wu Bo wrote: On 2023/11/7 22:39, Chao Yu wrote: On 2023/10/30 17:40, Wu Bo wrote: If GC victim has pinned block, it can'

[f2fs-dev] [PATCH 6/6] f2fs: add tracepoint for f2fs_vm_page_mkwrite()

2023-12-10 Thread Chao Yu
This patch adds to support tracepoint for f2fs_vm_page_mkwrite(), meanwhile it prints more details for trace_f2fs_filemap_fault(). Signed-off-by: Chao Yu --- fs/f2fs/file.c | 25 ++-- include/trace/events/f2fs.h | 39 - 2

[f2fs-dev] [PATCH 2/6] f2fs: delete obsolete FI_DROP_CACHE

2023-12-10 Thread Chao Yu
FI_DROP_CACHE was introduced in commit 1e84371ffeef ("f2fs: change atomic and volatile write policies") for volatile write feature, after commit 7bc155fec5b3 ("f2fs: kill volatile write support"), we won't support volatile write, let's delete related codes. Signed

  1   2   3   4   5   6   7   8   9   10   >