Re: [PATCH] f2fs: fix to cover allocate_segment() with lock

2021-04-19 Thread Chao Yu
On 2021/4/20 0:57, Jaegeuk Kim wrote: On 04/14, Chao Yu wrote: As we did for other cases, in fix_curseg_write_pointer(), let's change as below: - use callback function s_ops->allocate_segment() instead of raw function allocate_segment_by_default(); - cover allocate_segment() with curseg_l

Re: [f2fs-dev] [PATCH] fs: f2fs: Remove unnecessary struct declaration

2021-04-19 Thread Chao Yu
On 2021/4/19 10:20, Wan Jiabing wrote: struct dnode_of_data is defined at 897th line. The declaration here is unnecessary. Remove it. Signed-off-by: Wan Jiabing Reviewed-by: Chao Yu Thanks,

[RFC PATCH] f2fs: reduce expensive checkpoint trigger frequency

2021-04-16 Thread Chao Yu
directory, and then only trigger checkpoint() when target file's parent has non-persisted encryption policy, for the case its parent is not checkpointed, need_do_checkpoint() has cover that by verifying it with f2fs_is_checkpointed_node(). Signed-off-by: Chao Yu --- fs/f2fs/f2fs.h | 2 +

Re: [PATCH] direct-io: use read lock for DIO_LOCKING flag

2021-04-15 Thread Chao Yu
On 2021/4/16 8:43, Al Viro wrote: On Thu, Apr 15, 2021 at 12:24:13PM +0200, Jan Kara wrote: On Thu 15-04-21 17:43:32, Chao Yu wrote: 9902af79c01a ("parallel lookups: actual switch to rwsem") changes inode lock from mutex to rwsem, however, we forgot to adjust lock for DIO_LO

[PATCH] direct-io: use read lock for DIO_LOCKING flag

2021-04-15 Thread Chao Yu
meanwhile it still keeps original functionality of avoiding buffered access vs direct access. Signed-off-by: Chao Yu --- fs/direct-io.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/direct-io.c b/fs/direct-io.c index b2e86e739d7a..93ff912f2749 100644 --- a/fs/direct-

[PATCH] f2fs: fix to cover allocate_segment() with lock

2021-04-13 Thread Chao Yu
As we did for other cases, in fix_curseg_write_pointer(), let's change as below: - use callback function s_ops->allocate_segment() instead of raw function allocate_segment_by_default(); - cover allocate_segment() with curseg_lock and sentry_lock. Signed-off-by: Chao Yu --- fs/f2fs/segment.c

[PATCH] f2fs: document: add description about compressed space handling

2021-04-13 Thread Chao Yu
User or developer may still be confused about why f2fs doesn't expose compressed space to userspace, add description about compressed space handling policy into f2fs documentation. Signed-off-by: Chao Yu --- Documentation/filesystems/f2fs.rst | 8 1 file changed, 8 insertions(+) diff

Re: [f2fs-dev] [PATCH v2] f2fs: fix to avoid touching checkpointed data in get_victim()

2021-04-13 Thread Chao Yu
On 2021/4/13 10:59, Jaegeuk Kim wrote: On 04/11, Chao Yu wrote: Hi Jaegeuk, Could you please help to merge below cleanup diff into original patch? or merge this separately if it is too late since it is near rc7. I didn't review this tho, this gives an error in xfstests/083. From

[PATCH] f2fs: fix to avoid NULL pointer dereference

2021-04-13 Thread Chao Yu
1cc __generic_file_write_iter+0xc4/0x174 f2fs_file_write_iter+0x2c0/0x350 __vfs_write+0x104/0x134 vfs_write+0xe8/0x19c SyS_pwrite64+0x78/0xb8 To fix this issue, let's add page refcount add page-priavte flag. The page-private flag is not cleared and needs further analysis. Signed-off-by: Chao Yu Signed-

Re: [PATCH v3] f2fs: fix to keep isolation of atomic write

2021-04-12 Thread Chao Yu
On 2021/4/13 11:27, Jaegeuk Kim wrote: On 04/12, Chao Yu wrote: As Yi Chen reported, there is a potential race case described as below: Thread AThread B - f2fs_ioc_start_atomic_write - mkwrite

Re: [f2fs-dev] [PATCH v2] f2fs: fix to avoid touching checkpointed data in get_victim()

2021-04-12 Thread Chao Yu
On 2021/4/13 10:59, Jaegeuk Kim wrote: @@ -2701,7 +2689,7 @@ static void change_curseg(struct f2fs_sb_info *sbi, int type, bool flush) reset_curseg(sbi, type, 1); curseg->alloc_type = SSR; - __next_free_blkoff(sbi, curseg, 0); + __next_free_blkoff(sbi,

Re: [f2fs-dev] [PATCH v2] f2fs: fix to avoid touching checkpointed data in get_victim()

2021-04-12 Thread Chao Yu
On 2021/4/13 10:59, Jaegeuk Kim wrote: On 04/11, Chao Yu wrote: Hi Jaegeuk, Could you please help to merge below cleanup diff into original patch? or merge this separately if it is too late since it is near rc7. I didn't review this tho, this gives an error in xfstests/083. My bad, I hit

[PATCH v3] f2fs: fix to keep isolation of atomic write

2021-04-12 Thread Chao Yu
lation of atomic write in the case of start_atomic_write vs mkwrite, let start_atomic_write helds i_mmap_sem lock to avoid this issue. Reported-by: Yi Chen Signed-off-by: Chao Yu --- v3: - rebase to last dev branch - update commit message because this patch fixes a different racing issue of atomic wri

Re: [PATCH v2] f2fs: fix to avoid touching checkpointed data in get_victim()

2021-04-11 Thread Chao Yu
Hi Jaegeuk, Could you please help to merge below cleanup diff into original patch? or merge this separately if it is too late since it is near rc7. From 5a342a8f332a1b3281ec0e2b4d41b5287689c8ed Mon Sep 17 00:00:00 2001 From: Chao Yu Date: Sun, 11 Apr 2021 14:29:34 +0800 Subject: [PATCH] f2fs

Re: [PATCH v2] f2fs: fix the periodic wakeups of discard thread

2021-04-06 Thread Chao Yu
). But this is set even when there are no pending discard commands to be issued. 2. In the issue_discard_thread() path when there are no pending discard commands, it fails to reset the wait_ms to max timeout value. Signed-off-by: Sahitya Tummala Reviewed-by: Chao Yu Thanks,

Re: [PATCH v2 00/10] erofs: add big pcluster compression support

2021-04-02 Thread Chao Yu
r time on reading this! Nice job! Acked-by: Chao Yu Thanks, Thanks, Gao Xiang changes since v1: - add a missing vunmap in erofs_pcpubuf_exit(); - refine comments and commit messages. (btw, I'll apply this patchset for -next first for further integration test, which will be

[PATCH v2] f2fs: fix to avoid accessing invalid fio in f2fs_allocate_data_block()

2021-04-02 Thread Chao Yu
Callers may pass fio parameter with NULL value to f2fs_allocate_data_block(), so we should make sure accessing fio's field after fio's validation check. Fixes: f608c38c59c6 ("f2fs: clean up parameter of f2fs_allocate_data_block()") Signed-off-by: Chao Yu --- v2: - relocate fio->ret

Re: [f2fs-dev] [PATCH] f2fs: set checkpoint_merge by default

2021-04-01 Thread Chao Yu
On 2021/4/2 8:42, Jaegeuk Kim wrote: Once we introduced checkpoint_merge, we've seen some contention w/o the option. In order to avoid it, let's set it by default. Signed-off-by: Jaegeuk Kim Reviewed-by: Chao Yu Thanks,

[PATCH] f2fs: fix to avoid GC/mmap race with f2fs_truncate()

2021-03-31 Thread Chao Yu
It missed to hold i_gc_rwsem and i_map_sem around f2fs_truncate() in f2fs_file_write_iter() to avoid racing with background GC and mmap, fix it. Signed-off-by: Chao Yu --- fs/f2fs/file.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c

[PATCH] f2fs: fix to avoid accessing invalid fio in f2fs_allocate_data_block()

2021-03-31 Thread Chao Yu
Callers may pass fio parameter with NULL value to f2fs_allocate_data_block(), so we should make sure accessing fio's field after fio's validation check. Fixes: f608c38c59c6 ("f2fs: clean up parameter of f2fs_allocate_data_block()") Signed-off-by: Chao Yu --- fs/f2fs/segment.c | 6 +++-

Re: [f2fs-dev] [PATCH] Revert "f2fs: give a warning only for readonly partition"

2021-03-30 Thread Chao Yu
On 2021/3/31 9:57, Jaegeuk Kim wrote: On 03/27, Chao Yu wrote: On 2021/3/27 9:52, Chao Yu wrote: On 2021/3/27 1:30, Jaegeuk Kim wrote: On 03/26, Chao Yu wrote: On 2021/3/26 9:19, Jaegeuk Kim wrote: On 03/26, Chao Yu wrote: On 2021/3/25 9:59, Chao Yu wrote: On 2021/3/25 6:44, Jaegeuk Kim

[PATCH] f2fs: fix to restrict mount condition on readonly block device

2021-03-30 Thread Chao Yu
ition") Signed-off-by: Chao Yu --- fs/f2fs/super.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 954b1fe97d67..14239e2b7ae7 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -3966,10 +3966,18 @@ static int f2fs_

Re: [PATCH v2 4/4] erofs: add on-disk compression configurations

2021-03-29 Thread Chao Yu
On 2021/3/29 14:55, Gao Xiang wrote: I found a reference here, https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?h=v5.11#n99 also vaguely remembered some threads from Linus, but hard to find now :-( Sure, we can follow this rule for

Re: [PATCH v2 4/4] erofs: add on-disk compression configurations

2021-03-29 Thread Chao Yu
On 2021/3/29 14:36, Gao Xiang wrote: Hi Chao, On Mon, Mar 29, 2021 at 02:26:05PM +0800, Chao Yu wrote: On 2021/3/29 9:23, Gao Xiang wrote: From: Gao Xiang Add a bitmap for available compression algorithms and a variable-sized on-disk table for compression options in preparation for upcoming

Re: [PATCH v2 4/4] erofs: add on-disk compression configurations

2021-03-29 Thread Chao Yu
uperblock(struct super_block *sb) { struct erofs_sb_info *sbi; @@ -166,6 +298,12 @@ static int erofs_read_superblock(struct super_block *sb) if (!check_layout_compatibility(sb, dsb)) goto out; + sbi->sb_size = 128 + dsb->sb_extslots * 16; sbi->sb_size = sizeof(struct erofs_s

Re: [f2fs-dev] [PATCH] Revert "f2fs: give a warning only for readonly partition"

2021-03-27 Thread Chao Yu
On 2021/3/27 9:52, Chao Yu wrote: On 2021/3/27 1:30, Jaegeuk Kim wrote: On 03/26, Chao Yu wrote: On 2021/3/26 9:19, Jaegeuk Kim wrote: On 03/26, Chao Yu wrote: On 2021/3/25 9:59, Chao Yu wrote: On 2021/3/25 6:44, Jaegeuk Kim wrote: On 03/24, Chao Yu wrote: On 2021/3/24 12:22, Jaegeuk Kim

[PATCH] f2fs: introduce gc_merge mount option

2021-03-27 Thread Chao Yu
tion when GC is triggered from a process with limited I/O and CPU resources. Original idea is from Xiang. Signed-off-by: Gao Xiang Signed-off-by: Chao Yu --- Documentation/filesystems/f2fs.rst | 6 ++ fs/f2fs/f2fs.h | 1 + fs/f2fs/gc.c | 26 +

Re: [PATCH 4/4] erofs: add on-disk compression configurations

2021-03-27 Thread Chao Yu
On 2021/3/27 11:49, Gao Xiang wrote: From: Gao Xiang Add a bitmap for available compression algorithms and a variable-sized on-disk table for compression options in preparation for upcoming big pcluster and LZMA algorithm, which follows the end of super block. To parse the compression

Re: [PATCH 3/4] erofs: introduce on-disk lz4 fs configurations

2021-03-27 Thread Chao Yu
On 2021/3/27 11:49, Gao Xiang wrote: From: Gao Xiang Introduce z_erofs_lz4_cfgs to store all lz4 configurations. Currently it's only max_distance, but will be used for new features later. Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks,

Re: [PATCH 2/4] erofs: support adjust lz4 history window size

2021-03-27 Thread Chao Yu
for volume */ __u8 volume_name[16]; /* volume name */ __le32 feature_incompat; - __u8 reserved2[44]; + __le16 lz4_max_distance; It missed to add comments, otherwise it looks good to me. Reviewed-by: Chao Yu Thanks, + __u8 reserved2[42]; }; /* diff

Re: [PATCH 1/4] erofs: introduce erofs_sb_has_xxx() helpers

2021-03-27 Thread Chao Yu
On 2021/3/27 11:49, Gao Xiang wrote: From: Gao Xiang Introduce erofs_sb_has_xxx() to make long checks short, especially for later big pcluster & LZMA features. Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks,

Re: [f2fs-dev] [PATCH] Revert "f2fs: give a warning only for readonly partition"

2021-03-26 Thread Chao Yu
On 2021/3/27 1:30, Jaegeuk Kim wrote: On 03/26, Chao Yu wrote: On 2021/3/26 9:19, Jaegeuk Kim wrote: On 03/26, Chao Yu wrote: On 2021/3/25 9:59, Chao Yu wrote: On 2021/3/25 6:44, Jaegeuk Kim wrote: On 03/24, Chao Yu wrote: On 2021/3/24 12:22, Jaegeuk Kim wrote: On 03/24, Chao Yu wrote

[PATCH] f2fs: delete empty compress.h

2021-03-26 Thread Chao Yu
From: Chao Yu Commit 75e91c888989 ("f2fs: compress: fix compression chksum") wrongly introduced empty compress.h, delete it. Signed-off-by: Chao Yu --- fs/f2fs/compress.h | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 fs/f2fs/compress.h diff --git

Re: [PATCH v2] f2fs: fix to avoid touching checkpointed data in get_victim()

2021-03-26 Thread Chao Yu
On 2021/3/25 7:49, Jaegeuk Kim wrote: On 03/24, Chao Yu wrote: In CP disabling mode, there are two issues when using LFS or SSR | AT_SSR mode to select victim: 1. LFS is set to find source section during GC, the victim should have no checkpointed data, since after GC, section could not be set

[PATCH] f2fs: fix to cover __allocate_new_section() with curseg_lock

2021-03-25 Thread Chao Yu
In order to avoid race with f2fs_do_replace_block(). Fixes: f5a53edcf01e ("f2fs: support aligned pinned file") Signed-off-by: Chao Yu --- fs/f2fs/segment.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index e533192545b2..f1b0e832e

Re: [f2fs-dev] [PATCH] Revert "f2fs: give a warning only for readonly partition"

2021-03-25 Thread Chao Yu
On 2021/3/26 9:19, Jaegeuk Kim wrote: On 03/26, Chao Yu wrote: On 2021/3/25 9:59, Chao Yu wrote: On 2021/3/25 6:44, Jaegeuk Kim wrote: On 03/24, Chao Yu wrote: On 2021/3/24 12:22, Jaegeuk Kim wrote: On 03/24, Chao Yu wrote: On 2021/3/24 2:39, Jaegeuk Kim wrote: On 03/23, Chao Yu wrote

Re: [f2fs-dev] [PATCH -next] f2fs: fix a typo in inode.c

2021-03-25 Thread Chao Yu
On 2021/3/25 14:38, Ruiqi Gong wrote: Do a trivial typo fix. s/runing/running Reported-by: Hulk Robot Signed-off-by: Ruiqi Gong Reviewed-by: Chao Yu Thanks,

Re: [f2fs-dev] [PATCH] Revert "f2fs: give a warning only for readonly partition"

2021-03-25 Thread Chao Yu
On 2021/3/25 9:59, Chao Yu wrote: On 2021/3/25 6:44, Jaegeuk Kim wrote: On 03/24, Chao Yu wrote: On 2021/3/24 12:22, Jaegeuk Kim wrote: On 03/24, Chao Yu wrote: On 2021/3/24 2:39, Jaegeuk Kim wrote: On 03/23, Chao Yu wrote: This reverts commit 938a184265d75ea474f1c6fe1da96a5196163789

Re: [PATCH] Revert "f2fs: give a warning only for readonly partition"

2021-03-24 Thread Chao Yu
On 2021/3/25 6:44, Jaegeuk Kim wrote: On 03/24, Chao Yu wrote: On 2021/3/24 12:22, Jaegeuk Kim wrote: On 03/24, Chao Yu wrote: On 2021/3/24 2:39, Jaegeuk Kim wrote: On 03/23, Chao Yu wrote: This reverts commit 938a184265d75ea474f1c6fe1da96a5196163789. Because that commit fails generic/050

Re: [PATCH v2] f2fs: fix to avoid touching checkpointed data in get_victim()

2021-03-24 Thread Chao Yu
On 2021/3/25 7:49, Jaegeuk Kim wrote: On 03/24, Chao Yu wrote: In CP disabling mode, there are two issues when using LFS or SSR | AT_SSR mode to select victim: 1. LFS is set to find source section during GC, the victim should have no checkpointed data, since after GC, section could not be set

Re: [PATCH] Revert "f2fs: give a warning only for readonly partition"

2021-03-24 Thread Chao Yu
On 2021/3/24 12:22, Jaegeuk Kim wrote: On 03/24, Chao Yu wrote: On 2021/3/24 2:39, Jaegeuk Kim wrote: On 03/23, Chao Yu wrote: This reverts commit 938a184265d75ea474f1c6fe1da96a5196163789. Because that commit fails generic/050 testcase which expect failure during mount a recoverable readonly

Re: [PATCH RFC] f2fs: fix to avoid selecting full segment w/ {AT,}SSR allocator

2021-03-23 Thread Chao Yu
On 2021/3/24 6:59, Jaegeuk Kim wrote: On 03/19, Chao Yu wrote: On 2021/3/19 1:17, Jaegeuk Kim wrote: On 02/20, Chao Yu wrote: In cp disabling mode, there could be a condition - target segment has 128 ckpt valid blocks - GC migrates 128 valid blocks to other segment (segment is still in dirty

[PATCH] f2fs: fix to update last i_size if fallocate partially succeeds

2021-03-23 Thread Chao Yu
In the case of expanding pinned file, map.m_lblk and map.m_len will update in each round of section allocation, so in error path, last i_size will be calculated with wrong m_lblk and m_len, fix it. Fixes: f5a53edcf01e ("f2fs: support aligned pinned file") Signed-off-by: Chao Yu --

[PATCH v2] f2fs: fix to avoid touching checkpointed data in get_victim()

2021-03-23 Thread Chao Yu
via {AT,}SSR allocator, however there is no free space in targe segment. Fixes: 4354994f097d ("f2fs: checkpoint disabling") Fixes: 093749e296e2 ("f2fs: support age threshold based garbage collection") Signed-off-by: Chao Yu --- v2: - fix to check checkpointed data in sect

Re: [PATCH 2/2] f2fs: fix error path of f2fs_remount()

2021-03-23 Thread Chao Yu
Ping, On 2021/3/17 17:56, Chao Yu wrote: In error path of f2fs_remount(), it missed to restart/stop kernel thread or enable/disable checkpoint, then mount option status may not be consistent with real condition of filesystem, so let's reorder remount flow a bit as below and do recovery

Re: [PATCH] Revert "f2fs: give a warning only for readonly partition"

2021-03-23 Thread Chao Yu
On 2021/3/24 2:39, Jaegeuk Kim wrote: On 03/23, Chao Yu wrote: This reverts commit 938a184265d75ea474f1c6fe1da96a5196163789. Because that commit fails generic/050 testcase which expect failure during mount a recoverable readonly partition. I think we need to change generic/050, since f2fs

Re: [f2fs-dev] [PATCH -next] f2fs: fix wrong comment of nat_tree_lock

2021-03-23 Thread Chao Yu
On 2021/3/23 19:41, qiulaibin wrote: Do trivial comment fix of nat_tree_lock. Signed-off-by: qiulaibin Reviewed-by: Chao Yu Thanks,

Re: [PATCH] f2fs: fix to align to section for fallocate() on pinned file

2021-03-23 Thread Chao Yu
On 2021/3/24 2:32, Jaegeuk Kim wrote: On 03/23, Chao Yu wrote: On 2021/3/5 17:56, Chao Yu wrote: Now, fallocate() on a pinned file only allocates blocks which aligns to segment rather than section, so GC may try to migrate pinned file's block, and after several times of failure, pinned file's

Re: [PATCH] f2fs: fix to align to section for fallocate() on pinned file

2021-03-23 Thread Chao Yu
On 2021/3/5 17:56, Chao Yu wrote: Now, fallocate() on a pinned file only allocates blocks which aligns to segment rather than section, so GC may try to migrate pinned file's block, and after several times of failure, pinned file's block could be migrated to other place, however user won't

Re: [LTP] [f2fs] 02eb84b96b: ltp.swapon03.fail

2021-03-23 Thread Chao Yu
Signed-off-by: Guo Weichao Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim The test uses fallocate to preallocate the swap file and writes zeros to it. I'm not sure what pin refers to? 'pin' refers to pinned file feature in F2FS, the LBA(Logical Block Address) of a file is fixed

Re: [PATCH] f2fs: fix to avoid out-of-bounds memory access

2021-03-23 Thread Chao Yu
Hi butt3rflyh4ck, On 2021/3/23 13:48, butt3rflyh4ck wrote: Hi, I have tested the patch on 5.12.0-rc4+, it seems to fix the problem. Thanks for helping to test this patch. Thanks, Regards, butt3rflyh4ck. On Mon, Mar 22, 2021 at 7:47 PM Chao Yu wrote: butt3rflyh4ck reported a bug

[PATCH] Revert "f2fs: give a warning only for readonly partition"

2021-03-23 Thread Chao Yu
This reverts commit 938a184265d75ea474f1c6fe1da96a5196163789. Because that commit fails generic/050 testcase which expect failure during mount a recoverable readonly partition. Fixes: 938a184265d7 ("f2fs: give a warning only for readonly partition") Signed-off-by: Chao Yu --- fs/f2

[PATCH] f2fs: fix to avoid out-of-bounds memory access

2021-03-22 Thread Chao Yu
memory on nat_bitmap due to it uses wrong nid value as bitmap offset. [1] https://lore.kernel.org/lkml/cafco6xomwdr8pobek6en6-fs58kg9dorfadgjj-fnf-1x43...@mail.gmail.com/T/#u Reported-by: butt3rflyh4ck Signed-off-by: Chao Yu --- fs/f2fs/node.c | 3 +++ 1 file changed, 3 insertions(+) diff

[PATCH] f2fs: fix to check ckpt blocks of section in get_victim_by_default()

2021-03-22 Thread Chao Yu
In image which enables large section, if we disable checkpoint, during background GC, it needs to check whether there is checkpointed data in selected victim section, rather than segment, fix this. Fixes: 4354994f097d ("f2fs: checkpoint disabling") Signed-off-by: Chao Yu --- fs

Re: [PATCH RFC] f2fs: fix to avoid selecting full segment w/ {AT,}SSR allocator

2021-03-18 Thread Chao Yu
On 2021/3/19 1:17, Jaegeuk Kim wrote: On 02/20, Chao Yu wrote: In cp disabling mode, there could be a condition - target segment has 128 ckpt valid blocks - GC migrates 128 valid blocks to other segment (segment is still in dirty list) - GC migrates 384 blocks to target segment (segment has 128

Re: [PATCH v2] erofs: fix bio->bi_max_vecs behavior change

2021-03-18 Thread Chao Yu
On 2021/3/6 12:04, Gao Xiang wrote: From: Gao Xiang Martin reported an issue that directory read could be hung on the latest -rc kernel with some certain image. The root cause is that commit baa2c7c97153 ("block: set .bi_max_vecs as actual allocated vector number") changes .bi_max_vecs

[PATCH 1/2] f2fs: don't start checkpoint thread in readonly mountpoint

2021-03-17 Thread Chao Yu
In readonly mountpoint, there should be no write IOs include checkpoint IO, so that it's not needed to create kernel checkpoint thread. Signed-off-by: Chao Yu --- fs/f2fs/super.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c

[PATCH 2/2] f2fs: fix error path of f2fs_remount()

2021-03-17 Thread Chao Yu
) handle ckpt thread 3) handle flush thread 4) handle checkpoint disabling Signed-off-by: Chao Yu --- fs/f2fs/super.c | 47 ++- 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 6716af216dca..fa60f08c30bb

Re: [PATCH 2/2] erofs: use sync decompression for atomic contexts only

2021-03-17 Thread Chao Yu
in z_erofs_runqueue. Signed-off-by: Huang Jianan Signed-off-by: Guo Weichao Reviewed-by: Gao Xiang Reviewed-by: Chao Yu Thanks,

Re: [PATCH 1/2] erofs: use workqueue decompression for atomic contexts only

2021-03-17 Thread Chao Yu
-by: Huang Jianan Signed-off-by: Guo Weichao Reviewed-by: Gao Xiang Reviewed-by: Chao Yu Thanks,

Re: [PATCH] zonefs: fix to update .i_wr_refcnt correctly in zonefs_open_zone()

2021-03-16 Thread Chao Yu
On 2021/3/17 7:30, Damien Le Moal wrote: On 2021/03/16 21:30, Chao Yu wrote: In zonefs_open_zone(), if opened zone count is larger than .s_max_open_zones threshold, we missed to recover .i_wr_refcnt, fix this. Fixes: b5c00e975779 ("zonefs: open/close zone on file open/close")

[PATCH] zonefs: fix to update .i_wr_refcnt correctly in zonefs_open_zone()

2021-03-16 Thread Chao Yu
In zonefs_open_zone(), if opened zone count is larger than .s_max_open_zones threshold, we missed to recover .i_wr_refcnt, fix this. Fixes: b5c00e975779 ("zonefs: open/close zone on file open/close") Signed-off-by: Chao Yu --- fs/zonefs/super.c | 6 +++--- 1 file changed, 3 insert

Re: [PATCH v3] f2fs: allow to change discard policy based on cached discard cmds

2021-03-16 Thread Chao Yu
the memory pressure on the system due to f2fs pending discard cmds by changing the policy to DPOLICY_FORCE based on the nm_i->ram_thresh configured. Signed-off-by: Sahitya Tummala Reviewed-by: Chao Yu Thanks,

Re: [f2fs] ab2dbddfd0: BUG:kernel_NULL_pointer_dereference,address

2021-03-16 Thread Chao Yu
Hi Sahitya, Node manager was initialized after segment manager's initialization, so f2fs_available_free_memory() called from issue_discard_thread() may access invalid nm_i pointer, could you please check and fix this case? On 2021/3/16 12:58, kernel test robot wrote: Greeting, FYI, we

Re: [PATCH v6 2/2] erofs: decompress in endio if possible

2021-03-16 Thread Chao Yu
Hi Jianan, On 2021/3/16 11:15, Huang Jianan via Linux-erofs wrote: z_erofs_decompressqueue_endio may not be executed in the atomic context, for example, when dm-verity is turned on. In this scenario, data can be decompressed directly to get rid of additional kworker scheduling overhead. Also,

Re: [PATCH v6 1/2] erofs: avoid memory allocation failure during rolling decompression

2021-03-16 Thread Chao Yu
. Signed-off-by: Huang Jianan Signed-off-by: Guo Weichao Reviewed-by: Gao Xiang Reviewed-by: Chao Yu Thanks,

Re: [PATCH v5 1/2] erofs: avoid memory allocation failure during rolling decompression

2021-03-15 Thread Chao Yu
On 2021/3/5 17:58, Huang Jianan via Linux-erofs wrote: Currently, err would be treated as io error. Therefore, it'd be better to ensure memory allocation during rolling decompression to avoid such io error. In the long term, we might consider adding another !Uptodate case for such case.

Re: [PATCH] f2fs: fix the discard thread sleep timeout under high utilization

2021-03-15 Thread Chao Yu
Hi Sahitya, On 2021/3/15 17:45, Sahitya Tummala wrote: Hi Chao, On Mon, Mar 15, 2021 at 04:10:22PM +0800, Chao Yu wrote: Hi Sahitya, On 2021/3/15 15:46, Sahitya Tummala wrote: Hi Chao, On Mon, Mar 15, 2021 at 02:12:44PM +0800, Chao Yu wrote: Sahitya, On 2021/3/15 12:56, Sahitya Tummala

Re: [PATCH] f2fs: fix the discard thread sleep timeout under high utilization

2021-03-15 Thread Chao Yu
Hi Sahitya, On 2021/3/15 15:46, Sahitya Tummala wrote: Hi Chao, On Mon, Mar 15, 2021 at 02:12:44PM +0800, Chao Yu wrote: Sahitya, On 2021/3/15 12:56, Sahitya Tummala wrote: When f2fs is heavily utilized over 80%, the current discard policy sets the max sleep timeout of discard thread

Re: [PATCH] f2fs: fix the discard thread sleep timeout under high utilization

2021-03-15 Thread Chao Yu
Sahitya, On 2021/3/15 12:56, Sahitya Tummala wrote: When f2fs is heavily utilized over 80%, the current discard policy sets the max sleep timeout of discard thread as 50ms (DEF_MIN_DISCARD_ISSUE_TIME). But this is set even when there are no pending discard commands to be issued. This results

Re: [f2fs-dev] [PATCH v3] f2fs: add sysfs nodes to get runtime compression stat

2021-03-12 Thread Chao Yu
On 2021/3/11 10:32, Daeho Jeong wrote: From: Daeho Jeong I've added new sysfs nodes to show runtime compression stat since mount. compr_written_block - show the block count written after compression compr_saved_block - show the saved block count with compression compr_new_inode - show the

Re: [PATCH v2] f2fs: allow to change discard policy based on cached discard cmds

2021-03-11 Thread Chao Yu
the memory pressure on the system due to f2fs pending discard cmds by changing the policy to DPOLICY_FORCE based on the nm_i->ram_thresh configured. Signed-off-by: Sahitya Tummala --- v2: - by mistake the last else condition was modified, fix it now. Oh, yes, Reviewed-by: Chao Yu Thanks,

Re: [PATCH] f2fs: allow to change discard policy based on cached discard cmds

2021-03-10 Thread Chao Yu
the memory pressure on the system due to f2fs pending discard cmds by changing the policy to DPOLICY_FORCE based on the nm_i->ram_thresh configured. Agreed. Signed-off-by: Sahitya Tummala Reviewed-by: Chao Yu Thanks,

Re: [PATCH] configfs: Fix use-after-free issue in __configfs_open_file

2021-03-10 Thread Chao Yu
Hi Joel, Christoph, Al Does any one have time to review this patch, ten days past... Thanks, On 2021/3/5 11:29, Chao Yu wrote: +Cc fsdevel Ping, Any comments one this patch? On 2021/3/1 14:10, Chao Yu wrote: From: Daiyue Zhang Commit b0841eefd969 ("configfs: provide exclusion betwe

Re: [f2fs-dev] [PATCH v2] f2fs: add sysfs nodes to get accumulated compression info

2021-03-09 Thread Chao Yu
On 2021/3/9 21:00, Daeho Jeong wrote: 2021년 3월 9일 (화) 오후 6:22, Chao Yu 님이 작성: On 2021/3/5 10:24, Daeho Jeong wrote: From: Daeho Jeong Added acc_compr_inodes to show accumulated compressed inode count and acc_compr_blocks to show accumulated secured block count with I noticed

Re: [f2fs-dev] [PATCH v2] f2fs: expose # of overprivision segments

2021-03-09 Thread Chao Yu
On 2021/3/4 3:28, Jaegeuk Kim wrote: This is useful when checking conditions during checkpoint=disable in Android. Signed-off-by: Jaegeuk Kim Reviewed-by: Chao Yu Thanks,

Re: [f2fs-dev] [PATCH v2] f2fs: add sysfs nodes to get accumulated compression info

2021-03-09 Thread Chao Yu
On 2021/3/5 10:24, Daeho Jeong wrote: From: Daeho Jeong Added acc_compr_inodes to show accumulated compressed inode count and acc_compr_blocks to show accumulated secured block count with I noticed that these stat numbers are recorded in extra reserved area in hot node curseg journal, the

Re: [f2fs-dev] [PATCH] f2fs: expose # of overprivision segments

2021-03-08 Thread Chao Yu
On 2021/3/9 8:07, Jaegeuk Kim wrote: On 03/05, Chao Yu wrote: On 2021/3/5 1:50, Jaegeuk Kim wrote: On 03/04, Chao Yu wrote: On 2021/3/3 2:44, Jaegeuk Kim wrote: On 03/02, Jaegeuk Kim wrote: On 03/02, Chao Yu wrote: On 2021/3/2 13:42, Jaegeuk Kim wrote: This is useful when checking

Re: [f2fs-dev] [PATCH v4] f2fs: compress: add compress_inode to cache compressed blockst

2021-03-08 Thread Chao Yu
On 2021/3/9 8:01, Jaegeuk Kim wrote: On 03/05, Chao Yu wrote: On 2021/3/5 4:20, Jaegeuk Kim wrote: On 02/27, Jaegeuk Kim wrote: On 02/04, Chao Yu wrote: Jaegeuk, On 2021/2/2 16:00, Chao Yu wrote: - for (i = 0; i < dic->nr_cpages; i++) { + for (i = 0; i < cc->

Re: [PATCH v2] erofs: fix bio->bi_max_vecs behavior change

2021-03-07 Thread Chao Yu
On 2021/3/8 10:36, Gao Xiang wrote: Hi Chao, On Mon, Mar 08, 2021 at 09:29:30AM +0800, Chao Yu wrote: On 2021/3/6 12:04, Gao Xiang wrote: From: Gao Xiang Martin reported an issue that directory read could be hung on the latest -rc kernel with some certain image. The root cause

Re: [PATCH v2] erofs: fix bio->bi_max_vecs behavior change

2021-03-07 Thread Chao Yu
i_max_vecs behavior. bio->bi_max_vecs is set as actual allocated vector number rather than the requested number now. Let's avoid using .bi_max_vecs completely instead. Reported-by: Martin DEVERA Signed-off-by: Gao Xiang Looks good to me, btw, it needs to Cc stable mailing list? Reviewed-by: Chao Yu Thanks,

[PATCH] f2fs: fix to align to section for fallocate() on pinned file

2021-03-05 Thread Chao Yu
obsolete block address may be readed/written incorrectly. To avoid such condition, let's try to allocate pinned file's blocks with section alignment. Signed-off-by: Chao Yu --- fs/f2fs/f2fs.h| 2 +- fs/f2fs/file.c| 2 +- fs/f2fs/segment.c | 34 ++ 3 files

Re: [PATCH] configfs: Fix use-after-free issue in __configfs_open_file

2021-03-04 Thread Chao Yu
+Cc fsdevel Ping, Any comments one this patch? On 2021/3/1 14:10, Chao Yu wrote: From: Daiyue Zhang Commit b0841eefd969 ("configfs: provide exclusion between IO and removals") uses ->frag_dead to mark the fragment state, thus no bothering with extra refcount on config_item

Re: [f2fs-dev] [PATCH v4] f2fs: compress: add compress_inode to cache compressed blockst

2021-03-04 Thread Chao Yu
On 2021/3/5 4:20, Jaegeuk Kim wrote: On 02/27, Jaegeuk Kim wrote: On 02/04, Chao Yu wrote: Jaegeuk, On 2021/2/2 16:00, Chao Yu wrote: - for (i = 0; i < dic->nr_cpages; i++) { + for (i = 0; i < cc->nr_cpages; i++) { struct page *page = d

Re: [f2fs-dev] [PATCH] f2fs: expose # of overprivision segments

2021-03-04 Thread Chao Yu
On 2021/3/5 1:50, Jaegeuk Kim wrote: On 03/04, Chao Yu wrote: On 2021/3/3 2:44, Jaegeuk Kim wrote: On 03/02, Jaegeuk Kim wrote: On 03/02, Chao Yu wrote: On 2021/3/2 13:42, Jaegeuk Kim wrote: This is useful when checking conditions during checkpoint=disable in Android. This sysfs entry

Re: [f2fs-dev] [PATCH] f2fs: fix a redundant call to f2fs_balance_fs if an error occurs

2021-03-04 Thread Chao Yu
ode was changed") Signed-off-by: Colin Ian King Reviewed-by: Chao Yu Thanks,

Re: [f2fs-dev] [PATCH] f2fs: expose # of overprivision segments

2021-03-03 Thread Chao Yu
On 2021/3/3 2:44, Jaegeuk Kim wrote: On 03/02, Jaegeuk Kim wrote: On 03/02, Chao Yu wrote: On 2021/3/2 13:42, Jaegeuk Kim wrote: This is useful when checking conditions during checkpoint=disable in Android. This sysfs entry is readonly, how about putting this at /sys/fs/f2fs//stat/? Urg

Re: [PATCH] f2fs: fix compile warning

2021-03-02 Thread Chao Yu
On 2021/3/2 16:44, Chao Yu wrote: node.c:2750:13: note: in expansion of macro ‘min’ nrpages = min(last_offset - i, BIO_MAX_PAGES); Oh, after I rebase to last dev branch, compile warning is gone as we changed to use bio_max_segs() rather than min(). Please ignore this patch. Thanks,

[PATCH] f2fs: remove unused file_clear_encrypt()

2021-03-02 Thread Chao Yu
- file_clear_encrypt() was never be used, remove it. - In addition, relocating macros for cleanup. Signed-off-by: Chao Yu --- fs/f2fs/f2fs.h | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 4fc343aa0a08..ddd54f5cf932 100644

[PATCH] f2fs: fix compile warning

2021-03-02 Thread Chao Yu
min(x, y) __careful_cmp(x, y, <) ^ node.c:2750:13: note: in expansion of macro ‘min’ nrpages = min(last_offset - i, BIO_MAX_PAGES); Use min_t() rather than min() to do type cast before comparing. Signed-off-by: Chao Yu --- fs/f2fs/node.c | 3 ++- 1 file changed, 2 insertions(+),

Re: [f2fs-dev] [PATCH] f2fs: expose # of overprivision segments

2021-03-02 Thread Chao Yu
On 2021/3/2 13:42, Jaegeuk Kim wrote: This is useful when checking conditions during checkpoint=disable in Android. This sysfs entry is readonly, how about putting this at /sys/fs/f2fs//stat/? Signed-off-by: Jaegeuk Kim --- fs/f2fs/sysfs.c | 8 1 file changed, 8 insertions(+)

Re: [f2fs-dev] [PATCH v2 3/3] f2fs: check if swapfile is section-alligned

2021-03-01 Thread Chao Yu
to swap_extent, so swap will write to wrong address, which will cause data corruption. Signed-off-by: Huang Jianan Signed-off-by: Guo Weichao Reviewed-by: Chao Yu Thanks,

[PATCH] configfs: Fix use-after-free issue in __configfs_open_file

2021-02-28 Thread Chao Yu
ue, remove the config_item_put in __configfs_open_file to balance the refcount of config_item. Fixes: b0841eefd969 ("configfs: provide exclusion between IO and removals") Cc: Al Viro Cc: Joel Becker Cc: Christoph Hellwig Signed-off-by: Daiyue Zhang Signed-off-by: Yi Chen Signed-off-b

Re: [f2fs-dev] [PATCH][next] f2fs: Replace one-element array with flexible-array member

2021-02-28 Thread Chao Yu
On 2021/2/28 13:00, Jaegeuk Kim wrote: On 02/25, Chao Yu wrote: Hello, Gustavo, On 2021/2/25 3:03, Gustavo A. R. Silva wrote: There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use

Re: [f2fs-dev] [PATCH 3/3] f2fs: check if swapfile is section-alligned

2021-02-28 Thread Chao Yu
Hi Jianan, On 2021/2/27 20:02, Huang Jianan via Linux-f2fs-devel wrote: If the swapfile isn't created by pin and fallocate, it cann't be Typo: can't guaranteed section-aligned, so it may be selected by f2fs gc. When gc_pin_file_threshold is reached, the address of swapfile may change, but

Re: [f2fs-dev] [PATCH 2/3] f2fs: fix last_lblock check in check_swap_activate_fast

2021-02-28 Thread Chao Yu
max) { It's nitpick, if necessary, I guess Jaegeuk could help to change this while merging. Reviewed-by: Chao Yu Thanks, struct f2fs_map_blocks map; pgoff_t next_pgofs;

Re: [f2fs-dev] [PATCH 1/3] f2fs: remove unnecessary IS_SWAPFILE check

2021-02-28 Thread Chao Yu
-by: Guo Weichao Reviewed-by: Chao Yu Thanks,

Re: [f2fs-dev] [PATCH v3] f2fs: compress: Allow modular (de)compression algorithms

2021-02-26 Thread Chao Yu
. As modular dependency propagation through intermediate symbols is obscure, fix this in a robust way by moving the selection of tristate (de)compression algorithms from the boolean compression options to the tristate main F2FS_FS option. Signed-off-by: Geert Uytterhoeven Reviewed-by: Chao Yu

Re: [f2fs-dev] [PATCH] f2fs: compress: Allow modular (de)compression algorithms

2021-02-25 Thread Chao Yu
Hi Geert, On 2021/2/23 15:42, Geert Uytterhoeven wrote: I checked the code in menu_finalize(), and this seems to work like this. I discussed the oddity of the select behavior before (https://lore.kernel.org/linux-kbuild/e1a6228d-1341-6264-d97a-e2bd52a65...@infradead.org/), but I was not

Re: [f2fs-dev] [PATCH][next] f2fs: Replace one-element array with flexible-array member

2021-02-24 Thread Chao Yu
Hello, Gustavo, On 2021/2/25 3:03, Gustavo A. R. Silva wrote: There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of

  1   2   3   4   5   6   7   8   9   10   >