[f2fs-dev] [PATCH v2 2/3] f2fs: cleanup for 'f2fs_tuning_parameters' function

2022-11-14 Thread Yuwei Guan
A cleanup patch for 'f2fs_tuning_parameters' function. Signed-off-by: Yuwei Guan --- fs/f2fs/super.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 17b9e70b8f32..3e974c003b77 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @

[f2fs-dev] [PATCH v2 3/3] f2fs: change type for 'sbi->readdir_ra'

2022-11-14 Thread Yuwei Guan
Before this patch, the varibale 'readdir_ra' takes effect if it's equal to '1' or not, so we can change type for it from 'int' to 'bool'. Signed-off-by: Yuwei Guan --- fs/f2fs/dir.c | 2 +- fs/f2fs/f2fs.h | 2 +- fs/f2fs/super.c | 2 +- fs/f2fs/sysfs.c | 5 + 4 files changed, 8 insertions

[f2fs-dev] [PATCH v2 0/3] alloc_mode changed after remount on a small volume device

2022-11-14 Thread Yuwei Guan
This series contains a fix patch for alloc_mode changed after remount on a small volume device, and do cleanup for 'f2fs_tuning_parameters' function. The last one changes type for sbi->readdir_ra. V1 -> v2 : - set alloc_mode default state in default_options() - let variable readdir_ra holds the s

[f2fs-dev] [PATCH v2 1/3] f2fs: fix to alloc_mode changed after remount on a small volume device

2022-11-14 Thread Yuwei Guan
The commit 84b89e5d943d8 ("f2fs: add auto tuning for small devices") add tuning for small volume device, now support to tune alloce_mode to 'reuse' if it's small size. But the alloc_mode will change to 'default' when do remount on this small size dievce. This patch fo fix alloc_mode changed when do

Re: [f2fs-dev] [PATCH 1/3] f2fs: fix to alloc_mode changed after remount on a small volume device

2022-11-14 Thread Yuwei Guan
On 2022/11/15 9:23, Chao Yu wrote: On 2022/11/15 0:13, Yuwei Guan wrote: On 2022/11/14 22:42, Chao Yu wrote: On 2022/11/12 16:32, Yuwei Guan wrote: The commit 84b89e5d943d8 ("f2fs: add auto tuning for small devices") add tuning for small volume device, now support to tune alloce_mode to 're

Re: [f2fs-dev] [BUG REPORT] f2fs: use-after-free during garbage collection

2022-11-14 Thread Jun Nie
Chao Yu 于2022年11月15日周二 00:02写道: > > On 2022/11/14 9:47, Jun Nie wrote: > > Hi Chao & Jaegeuk, > > > > There is a KASAN report[0] that shows invalid memory > > access(use-after-free) in f2fs garbage collection process, and this > > issue is fixed by a recent f2fs patch set[1]. The KASAN report is

Re: [f2fs-dev] [PATCH v2 1/2] f2fs: fix to enable compress for newly created file if extension matches

2022-11-14 Thread Chao Yu
On 2022/11/15 8:20, Jaegeuk Kim wrote: On 11/14, Jaegeuk Kim wrote: If compress_extension is set, and a newly created file matches the extension, the file could be marked as compression file. However, if inline_data is also enabled, there is no chance to check its extension since f2fs_should_com

Re: [f2fs-dev] [PATCH] f2fs: remove submit label in __submit_discard_cmd()

2022-11-14 Thread Chao Yu
On 2022/11/15 6:49, Jaegeuk Kim wrote: On 11/12, Yangtao Li wrote: Complaint from Matthew Wilcox in another similar place: "submit? You don't submit anything at the 'submit' label. it should be called 'skip' or something. But I think this is just badly written and you

Re: [f2fs-dev] [PATCH v2 1/2] f2fs: fix to enable compress for newly created file if extension matches

2022-11-14 Thread Chao Yu
On 2022/11/15 6:39, Jaegeuk Kim wrote: If compress_extension is set, and a newly created file matches the extension, the file could be marked as compression file. However, if inline_data is also enabled, there is no chance to check its extension since f2fs_should_compress() always returns false.

Re: [f2fs-dev] [PATCH 1/3] f2fs: fix to alloc_mode changed after remount on a small volume device

2022-11-14 Thread Chao Yu
On 2022/11/15 0:13, Yuwei Guan wrote: On 2022/11/14 22:42, Chao Yu wrote: On 2022/11/12 16:32, Yuwei Guan wrote: The commit 84b89e5d943d8 ("f2fs: add auto tuning for small devices") add tuning for small volume device, now support to tune alloce_mode to 'reuse' if it's small size. But the alloc

[f2fs-dev] [PATCH v1] f2fs: avoid victim selection from previous victim section

2022-11-14 Thread Yonggil Song
When f2fs chooses GC victim in large section & LFS mode, next_victim_seg[gc_type] is referenced first. After segment is freed, next_victim_seg[gc_type] has the next segment number. However, next_victim_seg[gc_type] still has the last segment number even after the last segment of section is freed. I

Re: [f2fs-dev] [PATCH v2 1/2] f2fs: fix to enable compress for newly created file if extension matches

2022-11-14 Thread Jaegeuk Kim
On 11/14, Jaegeuk Kim wrote: > If compress_extension is set, and a newly created file matches the > extension, the file could be marked as compression file. However, > if inline_data is also enabled, there is no chance to check its > extension since f2fs_should_compress() always returns false. > >

Re: [f2fs-dev] [PATCH v3] f2fs: add proc entry to show discard_plist info

2022-11-14 Thread Jaegeuk Kim
On 11/11, Yangtao Li wrote: > This patch adds a new proc entry to show discard_plist > information in more detail, which is very helpful to > know the discard pend list count clearly. > > Such as: > > Discard pending list(Show diacrd command count on each entry): > 04943 1

Re: [f2fs-dev] [PATCH] f2fs: remove submit label in __submit_discard_cmd()

2022-11-14 Thread Jaegeuk Kim
On 11/12, Yangtao Li wrote: > Complaint from Matthew Wilcox in another similar place: > > "submit? You don't submit anything at the 'submit' label. > it should be called 'skip' or something. But I think this > is just badly written and you don't need a goto at all." > > Let's

Re: [f2fs-dev] [PATCH v6] f2fs: support errors=remount-ro|continue|panic mountoption

2022-11-14 Thread Jaegeuk Kim
On 11/14, Chao Yu wrote: > On 2022/11/8 9:17, Chao Yu wrote: > > Jaegeuk, > > > > On 2022/11/8 5:49, Jaegeuk Kim wrote: > > > Chao, > > > > > > Could you please run xfstests since I met some issues with this? > > > I had to drop this to test other patches. > > > > Oops, I ran xfstests on v5, I d

Re: [f2fs-dev] [PATCH v2 2/2] f2fs: move set_file_temperature into f2fs_new_inode

2022-11-14 Thread Jaegeuk Kim
Since the file name has already passed to f2fs_new_inode(), let's move set_file_temperature() into f2fs_new_inode(). Signed-off-by: Sheng Yong Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim --- fs/f2fs/namei.c | 62 +++-- 1 file changed, 29 insertio

Re: [f2fs-dev] [PATCH v2 1/2] f2fs: fix to enable compress for newly created file if extension matches

2022-11-14 Thread Jaegeuk Kim
If compress_extension is set, and a newly created file matches the extension, the file could be marked as compression file. However, if inline_data is also enabled, there is no chance to check its extension since f2fs_should_compress() always returns false. This patch moves set_compress_inode(), w

Re: [f2fs-dev] [PATCH v3 14/23] f2fs: Convert f2fs_write_cache_pages() to use filemap_get_folios_tag()

2022-11-14 Thread Vishal Moola
On Sun, Nov 13, 2022 at 11:02 PM Chao Yu wrote: > > On 2022/10/18 4:24, Vishal Moola (Oracle) wrote: > > Converted the function to use a folio_batch instead of pagevec. This is in > > preparation for the removal of find_get_pages_range_tag(). > > > > Also modified f2fs_all_cluster_page_ready to ta

[f2fs-dev] [Bug 216050] f2fs_gc occupies 100% cpu

2022-11-14 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=216050 --- Comment #86 from Yuriy Garin (yuriy.ga...@gmail.com) --- (In reply to Jaegeuk Kim from comment #79) Running this patch (and debug printk) on 6.0.8-arch1-1. -- You may reply to this email to add a comment. You are receiving this mail becaus

Re: [f2fs-dev] [PATCH 3/3] f2fs: change type for 'sbi->readdir_ra'

2022-11-14 Thread Yuwei Guan
On 2022/11/14 22:59, Chao Yu wrote: On 2022/11/12 16:32, Yuwei Guan wrote: Before this patch, the varibale 'readdir_ra' takes effect if it's equal to '1' or not, so we can change type for it from 'int' to 'bool'. Signed-off-by: Yuwei Guan ---   fs/f2fs/dir.c   | 7 +++   fs/f2fs/f2fs.h  |

Re: [f2fs-dev] [PATCH 1/3] f2fs: fix to alloc_mode changed after remount on a small volume device

2022-11-14 Thread Yuwei Guan
On 2022/11/14 22:42, Chao Yu wrote: On 2022/11/12 16:32, Yuwei Guan wrote: The commit 84b89e5d943d8 ("f2fs: add auto tuning for small devices") add tuning for small volume device, now support to tune alloce_mode to 'reuse' if it's small size. But the alloc_mode will change to 'default' when d

[f2fs-dev] [PATCH] f2fs: fix to do sanity check on i_extra_isize in is_alive()

2022-11-14 Thread Chao Yu
syzbot found a f2fs bug: BUG: KASAN: slab-out-of-bounds in data_blkaddr fs/f2fs/f2fs.h:2891 [inline] BUG: KASAN: slab-out-of-bounds in is_alive fs/f2fs/gc.c:1117 [inline] BUG: KASAN: slab-out-of-bounds in gc_data_segment fs/f2fs/gc.c:1520 [inline] BUG: KASAN: slab-out-of-bounds in do_garbage_colle

Re: [f2fs-dev] [PATCH v2 1/2] f2fs: fix to enable compress for newly created file if extension matches

2022-11-14 Thread Chao Yu
On 2022/11/12 9:27, Jaegeuk Kim wrote: Does thes make sense? Jaegeuk, Could you please send modified patches to mailing list, otherwise, I can not add comments on specified line. Thanks, https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git/commit/?h=dev-test&id=608460dfae20b9d2

Re: [f2fs-dev] [BUG REPORT] f2fs: use-after-free during garbage collection

2022-11-14 Thread Chao Yu
On 2022/11/14 9:47, Jun Nie wrote: Hi Chao & Jaegeuk, There is a KASAN report[0] that shows invalid memory access(use-after-free) in f2fs garbage collection process, and this issue is fixed by a recent f2fs patch set[1]. The KASAN report is caused by an abnormal sum->ofs_in_node value 0xc3f1 in

[f2fs-dev] [PATCH] f2fs: fix to do sanity check on i_extra_isize in is_alive()

2022-11-14 Thread Chao Yu
syzbot found a f2fs bug: BUG: KASAN: slab-out-of-bounds in data_blkaddr fs/f2fs/f2fs.h:2891 [inline] BUG: KASAN: slab-out-of-bounds in is_alive fs/f2fs/gc.c:1117 [inline] BUG: KASAN: slab-out-of-bounds in gc_data_segment fs/f2fs/gc.c:1520 [inline] BUG: KASAN: slab-out-of-bounds in do_garbage_colle

Re: [f2fs-dev] [PATCH 3/3] f2fs: change type for 'sbi->readdir_ra'

2022-11-14 Thread Chao Yu
On 2022/11/12 16:32, Yuwei Guan wrote: Before this patch, the varibale 'readdir_ra' takes effect if it's equal to '1' or not, so we can change type for it from 'int' to 'bool'. Signed-off-by: Yuwei Guan --- fs/f2fs/dir.c | 7 +++ fs/f2fs/f2fs.h | 2 +- fs/f2fs/super.c | 2 +- fs/f2f

Re: [f2fs-dev] [PATCH v2] fsck.f2fs: avoid uncessary recalculation

2022-11-14 Thread Chao Yu
On 2022/11/14 22:17, Sheng Yong wrote: There is no need to recalculate ADDRS_PER_INODE and ADDRS_PER_BLOCK, especially in a for loop. Signed-off-by: Sheng Yong Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists

Re: [f2fs-dev] [PATCH 1/3] f2fs: fix to alloc_mode changed after remount on a small volume device

2022-11-14 Thread Chao Yu
On 2022/11/12 16:32, Yuwei Guan wrote: The commit 84b89e5d943d8 ("f2fs: add auto tuning for small devices") add tuning for small volume device, now support to tune alloce_mode to 'reuse' if it's small size. But the alloc_mode will change to 'default' when do remount on this small size dievce. Th

[f2fs-dev] [PATCH v2] fsck.f2fs: avoid uncessary recalculation

2022-11-14 Thread Sheng Yong via Linux-f2fs-devel
There is no need to recalculate ADDRS_PER_INODE and ADDRS_PER_BLOCK, especially in a for loop. Signed-off-by: Sheng Yong --- fsck/fsck.c | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/fsck/fsck.c b/fsck/fsck.c index ebc60ad..df91c82 100644 --- a/fsck/fsc

Re: [f2fs-dev] [PATCH V2] f2fs: fix atgc bug on issue in 32bits platform

2022-11-14 Thread Arnd Bergmann
On Mon, Nov 14, 2022, at 10:23, Zhiguo Niu wrote: > Arnd Bergmann 于2022年11月11日周五 17:57写道: > so I just modify struct victim_entry as your suggestion: > diff --git a/fs/f2fs/gc.h b/fs/f2fs/gc.h > index 19b956c2d697..e2f25b8fd865 100644 > --- a/fs/f2fs/gc.h > +++ b/fs/f2fs/gc.h > @@ -56,16 +56,16 @@