[f2fs-dev] [PATCH] f2fs: attach/detach private value in pair

2023-04-05 Thread Jaegeuk Kim
uot;f2fs: restructure f2fs page.private layout") Signed-off-by: Jaegeuk Kim --- fs/f2fs/compress.c | 4 ++-- fs/f2fs/data.c | 6 -- fs/f2fs/f2fs.h | 48 -- 3 files changed, 22 insertions(+), 36 deletions(-) diff --git a/fs/f2fs/compres

Re: [f2fs-dev] [PATCH] f2fs: get out of a repeat loop when getting a locked data page

2023-04-05 Thread Jaegeuk Kim
On 03/27, Matthew Wilcox wrote: > On Mon, Mar 27, 2023 at 08:30:33AM -0700, Jaegeuk Kim wrote: > > On 03/26, Chao Yu wrote: > > > On 2023/3/24 5:39, Jaegeuk Kim wrote: > > > > https://bugzilla.kernel.org/show_bug.cgi?id=216050 > > > > > > > &

Re: [f2fs-dev] [PATCH v2] f2fs: merge lz4hc_compress_pages() to lz4_compress_pages()

2023-04-05 Thread Jaegeuk Kim
On 04/05, Chao Yu wrote: > On 2023/3/31 0:49, Yangtao Li wrote: > > +#ifdef CONFIG_F2FS_FS_LZ4HC > > + unsigned char level = F2FS_I(cc->inode)->i_compress_level; > > if (level) > > len = LZ4_compress_HC(cc->rbuf, cc->cbuf->cdata, cc->rlen, > > c

Re: [f2fs-dev] [PATCH] f2fs: convert to use sysfs_emit

2023-04-05 Thread Jaegeuk Kim
On 04/05, Chao Yu wrote: > On 2023/3/31 19:33, Yangtao Li wrote: > > Let's use sysfs_emit. > > > > Signed-off-by: Yangtao Li > > --- > > fs/f2fs/sysfs.c | 10 ++ > > 1 file changed, 2 insertions(+), 8 deletions(-) > > > > diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c > > index 9ddc6e

Re: [f2fs-dev] [PATCH] f2fs: fix to trigger a checkpoint in the end of foreground garbage collection

2023-04-05 Thread Jaegeuk Kim
On 04/05, Chao Yu wrote: > On 2023/4/5 5:39, Jaegeuk Kim wrote: > > Can we do like this? > > > > From 9a58f0e59364241aa31b555cfe793d278e39b0dc Mon Sep 17 00:00:00 2001 > > From: Jaegeuk Kim > > Date: Tue, 4 Apr 2023 14:36:00 -0700 > > Subject: [PATCH] f2fs

Re: [f2fs-dev] [DISCUSSION] f2fs for desktop

2023-04-04 Thread Jaegeuk Kim
Hi Juhyung, On 04/04, Juhyung Park wrote: > Hi everyone, > > I want to start a discussion on using f2fs for regular desktops/workstations. > > There are growing number of interests in using f2fs as the general > root file-system: > 2018: https://www.phoronix.com/news/GRUB-Now-Supports-F2FS > 202

Re: [f2fs-dev] [PATCH] f2fs: fix to trigger a checkpoint in the end of foreground garbage collection

2023-04-04 Thread Jaegeuk Kim
Can we do like this? >From 9a58f0e59364241aa31b555cfe793d278e39b0dc Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim Date: Tue, 4 Apr 2023 14:36:00 -0700 Subject: [PATCH] f2fs: do checkpoint when there's not enough free sections We didn't do checkpoint in FG_GC case, which may cause losi

Re: [f2fs-dev] [PATCH v2] f2fs: Fix system crash due to lack of free space in LFS

2023-04-04 Thread Jaegeuk Kim
On 04/04, Chao Yu wrote: > On 2023/4/4 1:01, Jaegeuk Kim wrote: > > On 04/01, Chao Yu wrote: > > > On 2023/3/21 8:12, Yonggil Song wrote: > > > > When f2fs tries to checkpoint during foreground gc in LFS mode, system > > > > crash occurs due to lack of

Re: [f2fs-dev] [PATCH] f2fs: fix to trigger a checkpoint in the end of foreground garbage collection

2023-04-03 Thread Jaegeuk Kim
On 03/24, Chao Yu wrote: > In order to reclaim free blocks in prefree sections before latter use. We were supposed to do checkpoint as is? > > Fixes: 6f8d4455060d ("f2fs: avoid fi->i_gc_rwsem[WRITE] lock in f2fs_gc") > Signed-off-by: Chao Yu > --- > fs/f2fs/f2fs.h| 1 + > fs/f2fs/gc.c

Re: [f2fs-dev] [PATCH] f2fs: remove struct victim_selection default_v_ops

2023-04-03 Thread Jaegeuk Kim
On 04/03, Yangtao Li wrote: > There is only single instance of these ops, so remove the indirection > and call get_victim_by_default directly. Originally this was intended to give a chance to provide other allocation option. Anyway, it seems quit hard to do it anymore. Minor tip is it'd be better

Re: [f2fs-dev] [PATCH] f2fs: fix to check readonly condition correctly

2023-04-03 Thread Jaegeuk Kim
On 04/02, Chao Yu wrote: > This patch does below changes: > > - If f2fs enables readonly feature or device is readonly, allow to > mount readonly mode only > - Introduce f2fs_dev_is_readonly() to indicate whether image or device > is readonly > - remove unnecessary f2fs_hw_is_readonly() in f2fs_wr

Re: [f2fs-dev] [PATCH v3] f2fs: add iostat latency statistics support for discard

2023-04-03 Thread Jaegeuk Kim
Could you split the patch which cleans up and adds it on top of it? On 03/30, Yangtao Li wrote: > In this patch, it adds to account discard latency. > > Reported-by: kernel test robot > Link: > https://lore.kernel.org/oe-kbuild-all/202303211005.rgxljvli-...@intel.com/ > Signed-off-by: Yangtao L

Re: [f2fs-dev] [PATCH] f2fs: support to show noage_extent_cache mount option

2023-04-03 Thread Jaegeuk Kim
On 03/31, Yangtao Li wrote: > This patch support noage_extent_cache mount option. > > Signed-off-by: Yangtao Li > --- > Documentation/filesystems/f2fs.rst | 2 ++ > fs/f2fs/super.c| 7 +++ > 2 files changed, 9 insertions(+) > > diff --git a/Documentation/filesystems/f2fs

Re: [f2fs-dev] [PATCH v2] f2fs: Fix system crash due to lack of free space in LFS

2023-04-03 Thread Jaegeuk Kim
On 04/01, Chao Yu wrote: > On 2023/3/21 8:12, Yonggil Song wrote: > > When f2fs tries to checkpoint during foreground gc in LFS mode, system > > crash occurs due to lack of free space if the amount of dirty node and > > dentry pages generated by data migration exceeds free space. > > The reproducti

Re: [f2fs-dev] [PATCH v2] f2fs: fix null pointer panic in tracepoint in __replace_atomic_write_block

2023-04-03 Thread Jaegeuk Kim
") Cc: Signed-off-by: Jaegeuk Kim --- fs/f2fs/segment.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 72bce3808394..2439d7029e64 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -257,7 +257,7 @@

[f2fs-dev] [PATCH] f2fs: fix null pointer panic in tracepoint in __replace_atomic_write_block

2023-04-03 Thread Jaegeuk Kim
We got a kernel panic if old_addr is NULL. Signed-off-by: Jaegeuk Kim --- fs/f2fs/segment.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 72bce3808394..2439d7029e64 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -257,7

Re: [f2fs-dev] [PATCH] f2fs: Fix f2fs_truncate_partial_nodes ftrace event

2023-03-28 Thread Jaegeuk Kim
On 03/28, Steven Rostedt wrote: > On Tue, 07 Mar 2023 17:40:24 + > patchwork-bot+f...@kernel.org wrote: > > > Hello: > > > > This patch was applied to jaegeuk/f2fs.git (dev) > > by Jaegeuk Kim : > > > > On Mon, 6 Mar 2023 12:25:49

[f2fs-dev] [GIT PULL] f2fs fix for 6.3-rc5

2023-03-28 Thread Jaegeuk Kim
Hi Linus, Could you please consider this pull request? Thanks, The following changes since commit fe15c26ee26efa11741a7b632e9f23b01aca4cc6: Linux 6.3-rc1 (2023-03-05 14:52:03 -0800) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git tag

Re: [f2fs-dev] [PATCH v1] mkfs.f2fs: Introduce configurable reserved sections

2023-03-27 Thread Jaegeuk Kim
On 03/17, Yonggil Song wrote: > Overview > > > This option allows zoned block device users to configure GC reserved and > overprovision area manually according to their demands on performance of > sustained write latency and WAF. > > Problem > === > > The overprovision segments that

[f2fs-dev] [PATCH] mkfs.f2fs: remove indentation

2023-03-27 Thread Jaegeuk Kim
Show info w/o it. Signed-off-by: Jaegeuk Kim --- lib/libf2fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libf2fs.c b/lib/libf2fs.c index 118e12592394..93b0604615c7 100644 --- a/lib/libf2fs.c +++ b/lib/libf2fs.c @@ -1046,7 +1046,7 @@ int get_device_info(int i

Re: [f2fs-dev] [PATCH] f2fs: get out of a repeat loop when getting a locked data page

2023-03-27 Thread Jaegeuk Kim
On 03/26, Chao Yu wrote: > On 2023/3/24 5:39, Jaegeuk Kim wrote: > > https://bugzilla.kernel.org/show_bug.cgi?id=216050 > > > > Somehow we're getting a page which has a different mapping. > > Let's avoid the infinite loop. > > > > Cc: > > S

Re: [f2fs-dev] [PATCH 2/3 v2] f2fs: factor out discard_cmd usage from general rb_tree use

2023-03-24 Thread Jaegeuk Kim
long long key; } __packed; Cc: Fixes: 004b68621897 ("f2fs: use rb-tree to track pending discard commands") Signed-off-by: Jaegeuk Kim --- Change log from v1: - fix a bug when spliting/merging discard commands fs/f2fs/extent_cache.c | 36

Re: [f2fs-dev] f2fs: factor out discard_cmd usage from general rb_tree use

2023-03-24 Thread Jaegeuk Kim
On 03/24, Colin King (gmail) wrote: > Hi, > > static analysis with clang scan build has detected a potential issue > introduced by the following commit: > > commit 7e9775a516ff6c1e73ee2b42ec563cafee38f42f > Author: Jaegeuk Kim > Date: Fri Mar 10 11:12:35 2023 -08

Re: [f2fs-dev] [PATCH v1] f2fs: Fix discard bug on zoned block devices with 2MiB zone size

2023-03-24 Thread Jaegeuk Kim
On 03/24, Chao Yu wrote: > On 2023/3/24 6:03, Jaegeuk Kim wrote: > > On 03/23, Chao Yu wrote: > > > On 2023/3/13 17:48, Yonggil Song wrote: > > > > When using f2fs on a zoned block device with 2MiB zone size, IO errors > > > > occurs because f2fs tries

Re: [f2fs-dev] [RFC PATCH] f2fs: preserve direct write semantics when buffering is forced

2023-03-23 Thread Jaegeuk Kim
On 03/24, Damien Le Moal wrote: > On Thu, 2023-03-23 at 16:46 -0700, Jaegeuk Kim wrote: > > On 03/23, Damien Le Moal wrote: > > > On Thu, 2023-03-23 at 15:14 -0700, Jaegeuk Kim wrote: > > > > On 03/20, Christoph Hellwig wrote: > > > > > On Mon, Feb 20,

Re: [f2fs-dev] [PATCH] f2fs: fix align check for npo2

2023-03-23 Thread Jaegeuk Kim
On 03/23, Yohan Joung wrote: > Fix alignment check to be correct in npo2 as well > > Signed-off-by: Yohan Joung > --- > fs/f2fs/segment.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c > index 055e70e77aa2..46458085a8d0 100644 > --

Re: [f2fs-dev] [RFC PATCH] f2fs: preserve direct write semantics when buffering is forced

2023-03-23 Thread Jaegeuk Kim
On 03/23, Damien Le Moal wrote: > On Thu, 2023-03-23 at 15:14 -0700, Jaegeuk Kim wrote: > > On 03/20, Christoph Hellwig wrote: > > > On Mon, Feb 20, 2023 at 01:20:04PM +0100, Hans Holmberg wrote: > > > > A) Supporting proper direct writes for zoned block devices wou

[f2fs-dev] [PATCH] f2fs: fix scheduling while atomic in decompression path

2023-03-23 Thread Jaegeuk Kim
] worker_thread+0x414/0x8bc [ 16.946472][C0] kthread+0x16c/0x1e0 [ 16.946486][C0] ret_from_fork+0x10/0x20 Fixes: bff139b49d9f ("f2fs: handle decompress only post processing in softirq") Signed-off-by: Jaegeuk Kim --- fs/f2fs/compress.c | 7 ++- fs/f2fs/f2fs.h | 1

Re: [f2fs-dev] [RFC PATCH] f2fs: preserve direct write semantics when buffering is forced

2023-03-23 Thread Jaegeuk Kim
On 02/20, Hans Holmberg wrote: > In some cases, e.g. for zoned block devices, direct writes are > forced into buffered writes that will populate the page cache > and be written out just like buffered io. > > Direct reads, on the other hand, is supported for the zoned > block device case. This has

Re: [f2fs-dev] [RFC PATCH] f2fs: preserve direct write semantics when buffering is forced

2023-03-23 Thread Jaegeuk Kim
On 03/20, Christoph Hellwig wrote: > On Mon, Feb 20, 2023 at 01:20:04PM +0100, Hans Holmberg wrote: > > A) Supporting proper direct writes for zoned block devices would > > be the best, but it is currently not supported (probably for > > a good but non-obvious reason). Would it be feasible to > > i

Re: [f2fs-dev] [PATCH v1] f2fs: Fix discard bug on zoned block devices with 2MiB zone size

2023-03-23 Thread Jaegeuk Kim
On 03/23, Chao Yu wrote: > On 2023/3/13 17:48, Yonggil Song wrote: > > When using f2fs on a zoned block device with 2MiB zone size, IO errors > > occurs because f2fs tries to write data to a zone that has not been reset. > > > > The cause is that f2fs tries to discard multiple zones at once. This

[f2fs-dev] [PATCH] f2fs: get out of a repeat loop when getting a locked data page

2023-03-23 Thread Jaegeuk Kim
https://bugzilla.kernel.org/show_bug.cgi?id=216050 Somehow we're getting a page which has a different mapping. Let's avoid the infinite loop. Cc: Signed-off-by: Jaegeuk Kim --- fs/f2fs/data.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/fs/f2fs/data.c

Re: [f2fs-dev] [PATCH] f2fs: apply zone capacity to all zone type

2023-03-21 Thread Jaegeuk Kim
On 03/21, Jaegeuk Kim wrote: > If we manage the zone capacity per zone type, it'll break the GC assumption. > And, the current logic complains valid block count mismatch. > Let's apply zone capacity to all zone type, if specified. > Added: Fixes: de881df97768 ("f2fs:

[f2fs-dev] [PATCH] f2fs: apply zone capacity to all zone type

2023-03-21 Thread Jaegeuk Kim
If we manage the zone capacity per zone type, it'll break the GC assumption. And, the current logic complains valid block count mismatch. Let's apply zone capacity to all zone type, if specified. Signed-off-by: Jaegeuk Kim --- fs/f2fs/segm

[f2fs-dev] [PATCH] fsck.f2fs: don't call report_zone on normal partition

2023-03-20 Thread Jaegeuk Kim
Report_zone is not supported on normal partition. Signed-off-by: Jaegeuk Kim --- fsck/fsck.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fsck/fsck.c b/fsck/fsck.c index 1b6f2c20b2b3..324c3d5d9304 100644 --- a/fsck/fsck.c +++ b/fsck/fsck.c @@ -2462,6 +2462,9 @@ static int

Re: [f2fs-dev] [PATCH v1] f2fs: Fix system crash due to lack of free space in LFS

2023-03-16 Thread Jaegeuk Kim
On 03/14, Yonggil Song wrote: > When f2fs tries to checkpoint during foreground gc in LFS mode, system > crash occurs due to lack of free space if the amount of dirty node and > dentry pages generated by data migration exceeds free space. > The reproduction sequence is as follows. > > - 20GiB cap

[f2fs-dev] [PATCH 2/3] f2fs: factor out discard_cmd usage from general rb_tree use

2023-03-13 Thread Jaegeuk Kim
long long key; } __packed; Cc: Fixes: 004b68621897 ("f2fs: use rb-tree to track pending discard commands") Signed-off-by: Jaegeuk Kim --- fs/f2fs/extent_cache.c | 36 +- fs/f2fs/f2fs.h | 23 +--- fs/f2fs/segment.c

[f2fs-dev] [PATCH 3/3] f2fs: remove entire rb_entry sharing

2023-03-13 Thread Jaegeuk Kim
; } __packed; Cc: Fixes: 13054c548a1c ("f2fs: introduce infra macro and data structure of rb-tree extent cache") Signed-off-by: Jaegeuk Kim --- fs/f2fs/extent_cache.c | 177 + fs/f2fs/f2fs.h | 6 -- 2 files changed, 71

[f2fs-dev] [PATCH 1/3] f2fs: factor out victim_entry usage from general rb_tree use

2023-03-13 Thread Jaegeuk Kim
[12] unsigned long long key; } __packed; Cc: Fixes: 093749e296e2 ("f2fs: support age threshold based garbage collection") Signed-off-by: Jaegeuk Kim --- fs/f2fs/extent_cache.c | 36 +-- fs/f2fs/f2fs.h | 15 + fs/f2fs/gc.c

[f2fs-dev] [PATCH 0/3] remove shared memory structures

2023-03-13 Thread Jaegeuk Kim
This series removes the use of rb_entry based on memory alignment which doesn't look like a right design when considering various architectures/compilers. v2 from v1: - adjusted Eric's review - refactored gc.c further to clean up Jaegeuk Kim (3): f2fs: factor out victim_entry

Re: [f2fs-dev] [PATCH] f2fs: fix unaligned field offset in 32-bits platform

2023-03-10 Thread Jaegeuk Kim
On 03/10, David Laight wrote: > From: Jaegeuk Kim > > Sent: 09 March 2023 23:55 > > > > On 03/08, David Laight wrote: > > > From: Chao Yu > > > > Sent: 07 March 2023 15:14 > > > > > > > > F2FS-fs (dm-x): i

[f2fs-dev] [PATCH 2/3] f2fs: factor out discard_cmd usage from general rb_tree use

2023-03-10 Thread Jaegeuk Kim
long long key; } __packed; Cc: Fixes: 004b68621897 ("f2fs: use rb-tree to track pending discard commands") Signed-off-by: Jaegeuk Kim --- fs/f2fs/extent_cache.c | 36 +- fs/f2fs/f2fs.h | 23 +--- fs/f2fs/segment.c

[f2fs-dev] [PATCH 1/3] f2fs: factor out victim_entry usage from general rb_tree use

2023-03-10 Thread Jaegeuk Kim
[12] unsigned long long key; } __packed; Cc: Fixes: 093749e296e2 ("f2fs: support age threshold based garbage collection") Signed-off-by: Jaegeuk Kim --- fs/f2fs/extent_cache.c | 36 +--- fs/f2fs/f2fs.h | 15 ++--

[f2fs-dev] [PATCH 3/3] f2fs: remove entire rb_entry sharing

2023-03-10 Thread Jaegeuk Kim
; } __packed; Cc: Fixes: 13054c548a1c ("f2fs: introduce infra macro and data structure of rb-tree extent cache") Signed-off-by: Jaegeuk Kim --- fs/f2fs/extent_cache.c | 177 + fs/f2fs/f2fs.h | 6 -- 2 files changed, 71

Re: [f2fs-dev] [PATCH] f2fs: fix unaligned field offset in 32-bits platform

2023-03-09 Thread Jaegeuk Kim
On 03/08, David Laight wrote: > From: Chao Yu > > Sent: 07 March 2023 15:14 > > > > F2FS-fs (dm-x): inconsistent rbtree, cur(3470333575168) next(3320009719808) > > [ cut here ] > > kernel BUG at fs/f2fs/gc.c:602! > > Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM > > P

Re: [f2fs-dev] [PATCH] f2fs: fix unaligned field offset in 32-bits platform

2023-03-09 Thread Jaegeuk Kim
On 03/07, Chao Yu wrote: > F2FS-fs (dm-x): inconsistent rbtree, cur(3470333575168) next(3320009719808) > [ cut here ] > kernel BUG at fs/f2fs/gc.c:602! > Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM > PC is at get_victim_by_default+0x13c0/0x1498 > LR is at f2fs_check_r

Re: [f2fs-dev] kernel BUG at fs/f2fs/extent_cache.c:730 and subsequent warning (6.2-rc8)

2023-03-07 Thread Jaegeuk Kim
Hi, I think this should fix the issue. By any chance, could you give it a try? https://patchwork.kernel.org/project/f2fs/patch/20230307151408.58490-1-c...@kernel.org/ Thanks, On 02/14, Ondřej Jirman wrote: > On Tue, Feb 14, 2023 at 10:07:23PM +0100, megi xff wrote: > > Hello, > > > > I'm tryin

Re: [f2fs-dev] [PATCH] f2fs: fix unaligned field offset in 32-bits platform

2023-03-07 Thread Jaegeuk Kim
Cc'ed stable. Thanks. On 03/07, Chao Yu wrote: > F2FS-fs (dm-x): inconsistent rbtree, cur(3470333575168) next(3320009719808) > [ cut here ] > kernel BUG at fs/f2fs/gc.c:602! > Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM > PC is at get_victim_by_default+0x13c0/0x1498

Re: [f2fs-dev] [PATCH v2] f2fs: fix uninitialized skipped_gc_rwsem

2023-03-06 Thread Jaegeuk Kim
On 02/16, Yonggil Song wrote: > When f2fs skipped a gc round during victim migration, there was a bug which > would skip all upcoming gc rounds unconditionally because skipped_gc_rwsem > was not initialized. It fixes the bug by correctly initializing the > skipped_gc_rwsem inside the gc loop. > >

Re: [f2fs-dev] [PATCH] f2fs: fix to check quota inums

2023-03-06 Thread Jaegeuk Kim
On 02/23, Yangtao Li wrote: > We should check quota file ino before enable quota, and not only 0. > > BTW fix following check error: > > WARNING: Do not crash the kernel unless it is absolutely > unavoidable--use WARN_ON_ONCE() plus recovery code (if feasible) > instead of BUG() or variants. > >

[f2fs-dev] [PATCH] f2fs-tools: relax zone size of power of 2

2023-03-02 Thread Jaegeuk Kim
Let's relax this for Android support. Change-Id: Ic46593ef429e23b5d85977da374a95015ee72154 Signed-off-by: Jaegeuk Kim --- lib/libf2fs.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/libf2fs.c b/lib/libf2fs.c index f63307a42a08..118e12592394 100644 ---

Re: [f2fs-dev] [PATCH v2 00/11] fsverity: support for non-4K pages

2023-02-27 Thread Jaegeuk Kim
On 02/28, Eric Biggers wrote: > On Tue, Feb 28, 2023 at 01:01:54AM +, patchwork-bot+f...@kernel.org wrote: > > Hello: > > > > This series was applied to jaegeuk/f2fs.git (dev) > > by Eric Biggers : > > > > On Fri, 23 Dec 2022 12:36:27 -0800 you wrote: > > > [This patchset applies to mainline

[f2fs-dev] [GIT PULL] f2fs update for 6.3-rc1

2023-02-27 Thread Jaegeuk Kim
_move_inline_dirents() f2fs: fix cgroup writeback accounting with fs-layer encryption Jaegeuk Kim (4): f2fs: retry to update the inode page given data corruption f2fs: fix kernel crash due to null io->bio f2fs: fix wrong segment count f2fs: Revert "f2fs: trun

Re: [f2fs-dev] [PATCH] f2fs: make kobj_type structures constant

2023-02-15 Thread Jaegeuk Kim
On 02/15, Chao Yu wrote: > On 2023/2/15 2:07, Jaegeuk Kim wrote: > > On 02/14, Chao Yu wrote: > > > On 2023/2/14 1:51, Jaegeuk Kim wrote: > > > > On 02/13, Chao Yu wrote: > > > > > On 2023/2/9 11:20, Thomas Weißschuh wrote: > > > > &g

[f2fs-dev] [PATCH] f2fs: Revert "f2fs: truncate blocks in batch in __complete_revoke_list()"

2023-02-14 Thread Jaegeuk Kim
We should not truncate replaced blocks, and were supposed to truncate the first part as well. This reverts commit 78a99fe6254cad4be310cd84af39f6c46b668c72. Cc: sta...@vger.kernel.org Signed-off-by: Jaegeuk Kim --- fs/f2fs/segment.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions

[f2fs-dev] [PATCH] f2fs: Revert "f2fs: truncate blocks in batch in __complete_revoke_list()"

2023-02-14 Thread Jaegeuk Kim
We should not truncate replaced blocks, and were supposed to truncate the first part as well. This reverts commit 78a99fe6254cad4be310cd84af39f6c46b668c72. Signed-off-by: Jaegeuk Kim --- fs/f2fs/segment.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fs/f2fs

Re: [f2fs-dev] [PATCH] f2fs: make kobj_type structures constant

2023-02-14 Thread Jaegeuk Kim
On 02/14, Chao Yu wrote: > On 2023/2/14 1:51, Jaegeuk Kim wrote: > > On 02/13, Chao Yu wrote: > > > On 2023/2/9 11:20, Thomas Weißschuh wrote: > > > > Since commit ee6d3dd4ed48 ("driver core: make kobj_type constant.") > > > > the dr

Re: [f2fs-dev] [PATCH] f2fs: fix wrong segment count

2023-02-14 Thread Jaegeuk Kim
On 02/14, Chao Yu wrote: > On 2023/2/14 1:48, Jaegeuk Kim wrote: > > On 02/13, Chao Yu wrote: > > > On 2023/2/11 5:32, Jaegeuk Kim wrote: > > > > MAIN_SEGS is for data area, while TOTAL_SEGS includes data and metadata. > > > > > > Good cat

Re: [f2fs-dev] [PATCH] mkfs.f2fs: trim all the devices except the first one

2023-02-13 Thread Jaegeuk Kim
On 02/13, Chao Yu wrote: > On 2023/2/9 5:25, Jaegeuk Kim wrote: > > We need to check the first disk only, and trim the other disks. > > I'm confused, why we don't need to trim first disk? dd9c372646ed ("mkfs.f2fs: check zeros in first 16MB for Android") - We a

Re: [f2fs-dev] [PATCH v2] f2fs: fix wrong segment count

2023-02-13 Thread Jaegeuk Kim
MAIN_SEGS is for data area, while TOTAL_SEGS includes data and metadata. Signed-off-by: Jaegeuk Kim --- Change log from v1: - replace check_seg_range with valid_main_segno to avoid confusion. fs/f2fs/segment.h | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fs

Re: [f2fs-dev] [PATCH] f2fs: make kobj_type structures constant

2023-02-13 Thread Jaegeuk Kim
On 02/13, Chao Yu wrote: > On 2023/2/9 11:20, Thomas Weißschuh wrote: > > Since commit ee6d3dd4ed48 ("driver core: make kobj_type constant.") > > the driver core allows the usage of const struct kobj_type. > > > > Take advantage of this to constify the structure definitions to prevent > > modifica

Re: [f2fs-dev] [PATCH] f2fs: fix wrong segment count

2023-02-13 Thread Jaegeuk Kim
On 02/13, Chao Yu wrote: > On 2023/2/11 5:32, Jaegeuk Kim wrote: > > MAIN_SEGS is for data area, while TOTAL_SEGS includes data and metadata. > > Good catch! > > Could you please add fixes line? It seems this is not a bug case, and exisits from the first F2FS p

[f2fs-dev] [PATCH] f2fs-tools: fix # of total segments

2023-02-10 Thread Jaegeuk Kim
TOTAL_SEGS should include metadata segments and main segments. Signed-off-by: Jaegeuk Kim --- fsck/f2fs.h | 2 +- fsck/fsck.c | 4 ++-- fsck/mount.c | 26 +- fsck/resize.c | 8 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/fsck/f2fs.h

[f2fs-dev] [PATCH] f2fs: fix wrong segment count

2023-02-10 Thread Jaegeuk Kim
MAIN_SEGS is for data area, while TOTAL_SEGS includes data and metadata. Signed-off-by: Jaegeuk Kim --- fs/f2fs/segment.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h index 8ee5e5db9287..6003fbaf4b7d 100644 --- a/fs/f2fs/segment.h

Re: [f2fs-dev] [PATCH] f2fs: fix to release compress file for F2FS_IOC_RESERVE_COMPRESS_BLOCKS when has no space

2023-02-10 Thread Jaegeuk Kim
On 02/10, Yangtao Li wrote: > When the released file is reserving and the space is insufficient, > the fsck flag is set incorrectly, and lead to the file cannot be > reserved and released normally. > > $ mount -t f2fs -o compress_extension=*,compress_mode=user /mnt/9p/f2fs.img > /mnt/f2fs/ >

Re: [f2fs-dev] [PATCH] f2fs: export ipu policy in debugfs

2023-02-09 Thread Jaegeuk Kim
On 02/09, Yangtao Li wrote: > Export ipu_policy as a string in debugfs for better readability and > it can help us better understand some strategies of the file system. > > Since we use ipu_policy as a bitmap, and the bitmap API parameter is > unsigned long type data, let's change ipu_policy to un

[f2fs-dev] [PATCH] mkfs.f2fs: trim all the devices except the first one

2023-02-08 Thread Jaegeuk Kim
We need to check the first disk only, and trim the other disks. Signed-off-by: Jaegeuk Kim --- mkfs/f2fs_format_utils.c | 4 1 file changed, 4 insertions(+) diff --git a/mkfs/f2fs_format_utils.c b/mkfs/f2fs_format_utils.c index 597c2b3a7b1c..448fbaa8866e 100644 --- a/mkfs

Re: [f2fs-dev] [PATCH v4 3/3] f2fs: introduce ipu_mode sysfs node

2023-02-07 Thread Jaegeuk Kim
On 02/06, Yangtao Li wrote: > Add a ipu_mode sysfs node to show the current ipu policy as a string > for readability, like we do in commit a3951cd199a5 ("f2fs: introduce > gc_mode sysfs node"). > > Since we use ipu_policy as a bitmap, and the bitmap API parameter is > unsigned long type data, let'

Re: [f2fs-dev] [PATCH v4 1/3] f2fs: fix to set ipu policy

2023-02-07 Thread Jaegeuk Kim
On 02/07, Chao Yu wrote: > On 2023/2/6 22:43, Yangtao Li wrote: > > For LFS mode, it should update outplace and no need inplace update. > > When using LFS mode for small-volume devices, IPU will not be used, > > and the OPU writing method is actually used, but F2FS_IPU_FORCE can > > be read from th

Re: [f2fs-dev] [PATCH 2/2 v4] f2fs: add sysfs nodes to set last_age_weight

2023-02-07 Thread Jaegeuk Kim
On 02/07, Chao Yu wrote: > On 2023/2/4 17:43, qixiaoyu1 wrote: > > Signed-off-by: qixiaoyu1 > > Signed-off-by: xiongping1 > > --- > > change log v3 -> v4: > >- allow 0 and 100 to a valid value > > > > Documentation/ABI/testing/sysfs-fs-f2fs | 5 + > > fs/f2fs/extent_cache.c

[f2fs-dev] [PATCH] f2fs_io: support AES_256_HCTR2

2023-02-06 Thread Jaegeuk Kim
Signed-off-by: Jaegeuk Kim --- tools/f2fs_io/f2fs_io.c | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/tools/f2fs_io/f2fs_io.c b/tools/f2fs_io/f2fs_io.c index 6dcd84091583..5bc0baf40421 100644 --- a/tools/f2fs_io/f2fs_io.c +++ b/tools/f2fs_io/f2fs_io.c

[f2fs-dev] [PATCH] f2fs: fix kernel crash due to null io->bio

2023-02-05 Thread Jaegeuk Kim
x10/0x10 kthread+0xff/0x130 ? __pfx_kthread+0x10/0x10 ret_from_fork+0x2c/0x50 Cc: sta...@vger.kernel.org # v5.18+ Fixes: 64bf0eef0171 ("f2fs: pass the bio operation to bio_alloc_bioset") Signed-off-by: Jaegeuk Kim --- fs/f2fs/data.c | 4 1 file changed, 4 insertions(+) di

[f2fs-dev] [PATCH] f2fs-tools: Remove deprecated f2fstat

2023-02-05 Thread Jaegeuk Kim
Let's remove this. Signed-off-by: Jaegeuk Kim --- .gitignore| 1 - tools/Makefile.am | 3 +- tools/f2fstat.c | 311 -- 3 files changed, 1 insertion(+), 314 deletions(-) delete mode 100644 tools/f2fstat.c diff --git a/.gitign

Re: [f2fs-dev] [PATCH 1/3] f2fs: clean up __update_extent_tree_range()

2023-02-05 Thread Jaegeuk Kim
On 02/01, Chao Yu wrote: > On 2023/2/1 2:56, Jaegeuk Kim wrote: > > I wanted to avoid a deep if/else statement. > > So how about this: Nothing impressive. > > From 418b408420367ac5491c97a7c4d26e3d0e68ea57 Mon Sep 17 00:00:00 2001 > From: Chao Yu > Date: Tue,

Re: [f2fs-dev] [PATCH -next] f2fs: Remove unneeded semicolon

2023-02-02 Thread Jaegeuk Kim
Thanks, but applied the fix in the original patch. On 02/02, Yang Li wrote: > ./fs/f2fs/checkpoint.c:1485:55-56: Unneeded semicolon > > Reported-by: Abaci Robot > Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3925 > Signed-off-by: Yang Li > --- > fs/f2fs/checkpoint.c | 2 +- > 1 file ch

Re: [f2fs-dev] [PATCH v4 2/2] f2fs: clean up parameters of iostat_update_and_unbind_ctx()

2023-02-02 Thread Jaegeuk Kim
I combined two patches into one w/ Chao's reviewed-by. Let me know if you have other concern. On 02/01, Yangtao Li wrote: > From: Chao Yu > > Parsing sync/rw type from bio inside iostat_update_and_unbind_ctx() > to avoid unnecessary parameters. > > Signed-off-by: Chao Yu > [Yangtao: remove lat

Re: [f2fs-dev] [PATCH 1/3] f2fs: clean up __update_extent_tree_range()

2023-01-31 Thread Jaegeuk Kim
On 01/31, Chao Yu wrote: > No logic change, just avoid goto statement. I wanted to avoid a deep if/else statement. > > Signed-off-by: Chao Yu > --- > fs/f2fs/extent_cache.c | 66 -- > 1 file changed, 31 insertions(+), 35 deletions(-) > > diff --git a/fs

Re: [f2fs-dev] [PATCH v3 2/2] f2fs: use iostat_lat_type directly as a parameter in the iostat_update_and_unbind_ctx()

2023-01-31 Thread Jaegeuk Kim
On 01/31, Chao Yu wrote: > On 2023/1/21 0:16, Yangtao Li wrote: > > Convert to use iostat_lat_type as parameter instead of raw number. > > BTW, move NUM_PREALLOC_IOSTAT_CTXS to the header file, and rename > > iotype to page_type to match the definition. > > > > Reported-by: kernel test robot > >

Re: [f2fs-dev] [PATCH v2] f2fs: retry to update the inode page given EIO

2023-01-30 Thread Jaegeuk Kim
On 01/28, Chao Yu wrote: > On 2023/1/13 8:01, Jaegeuk Kim wrote: > > On 01/12, Chao Yu wrote: > > > On 2023/1/12 2:50, Jaegeuk Kim wrote: > > > > On 01/11, Chao Yu wrote: > > > > > On 2023/1/11 9:20, Jaegeuk Kim wrote: > > > > > >

Re: [f2fs-dev] [PATCH v3] f2fs: retry to update the inode page given EIO

2023-01-30 Thread Jaegeuk Kim
Huang Suggested-by: Chao Yu Signed-off-by: Jaegeuk Kim --- Change log from v2: - adopting the retry logic fs/f2fs/inode.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index e1d6e021e82b..7bf660d4cad9 100644 --- a/fs

Re: [f2fs-dev] [PATCH 4/8] f2fs: factor the read/write tracing logic into a helper

2023-01-30 Thread Jaegeuk Kim
On 01/29, Chao Yu wrote: > On 2023/1/19 14:36, Christoph Hellwig wrote: > > Factor the logic to log a path for reads and writs into a helper > > shared between the read_iter and write_iter methods. > > > > Signed-off-by: Christoph Hellwig > > --- > > fs/f2fs/file.c | 60 +---

Re: [f2fs-dev] [PATCH 1/4] f2fs: fix to set ipu policy

2023-01-30 Thread Jaegeuk Kim
Please adjust the comments based on v2. On 01/28, Chao Yu wrote: > On 2023/1/20 21:40, Yangtao Li wrote: > > For LFS mode, it should update outplace and no need inplace update. > > When using LFS mode for small-volume devices, IPU will not be used, > > and the OPU writing method is actually used,

Re: [f2fs-dev] [PATCH] f2fs: use iostat_lat_type directly as a parameter in the iostat_update_and_unbind_ctx()

2023-01-30 Thread Jaegeuk Kim
On 01/30, Jaegeuk Kim wrote: > On 01/28, Chao Yu wrote: > > On 2023/1/5 12:22, Yangtao Li wrote: > > > Convert to use iostat_lat_type as parameter instead of raw number. > > > BTW, move NUM_PREALLOC_IOSTAT_CTXS to the header file, and rename > > > iotype

Re: [f2fs-dev] [PATCH] f2fs: use iostat_lat_type directly as a parameter in the iostat_update_and_unbind_ctx()

2023-01-30 Thread Jaegeuk Kim
On 01/28, Chao Yu wrote: > On 2023/1/5 12:22, Yangtao Li wrote: > > Convert to use iostat_lat_type as parameter instead of raw number. > > BTW, move NUM_PREALLOC_IOSTAT_CTXS to the header file, and rename > > iotype to page_type to match the definition. > > > > Signed-off-by: Yangtao Li > > --- >

Re: [f2fs-dev] [PATCH 3/5] fs: f2fs: initialize fsdata in pagecache_write()

2023-01-26 Thread Jaegeuk Kim
On 01/22, Eric Biggers wrote: > On Mon, Nov 21, 2022 at 07:53:19PM +, Eric Biggers wrote: > > On Mon, Nov 21, 2022 at 12:21:32PM +0100, Alexander Potapenko wrote: > > > When aops->write_begin() does not initialize fsdata, KMSAN may report > > > an error passing the latter to aops->write_end().

Re: [f2fs-dev] [PATCH] f2fs: export compress_percent and compress_watermark entries

2023-01-18 Thread Jaegeuk Kim
On 01/17, Yangtao Li wrote: > This patch export below sysfs entries for better control cached > compress page count. > > /sys/fs/f2fs//compress_watermark > /sys/fs/f2fs//compress_percent > > Signed-off-by: Yangtao Li > --- > Documentation/ABI/testing/sysfs-fs-f2fs | 17 + > fs/f

Re: [f2fs-dev] [PATCH] f2fs: introduce sanity_check_blocks()

2023-01-18 Thread Jaegeuk Kim
On 01/12, Yangtao Li wrote: > There are very similar codes in release_compress_blocks() and > reserve_compress_blocks() which is used for data blocks check. > > This patch introduces a new helper sanity_check_blocks() > to include those common codes, and used it instead for cleanup. > > Signed-of

Re: [f2fs-dev] [PATCH] f2fs: add compression feature check for all compress mount opt

2023-01-18 Thread Jaegeuk Kim
On 01/13, Yangtao Li wrote: > Opt_compress_chksum, Opt_compress_mode and Opt_compress_cache > lack the necessary check to see if the image supports compression, > let's add it. > > Signed-off-by: Yangtao Li > --- > fs/f2fs/super.c | 55 + > 1 file

Re: [f2fs-dev] [PATCH v2 1/2] f2fs: fix to avoid potential memory corruption in __update_iostat_latency()

2023-01-18 Thread Jaegeuk Kim
On 01/16, Yangtao Li wrote: > Hi Chao, > > > Maybe it's betterr to merge these two check condition as below? > > > > if (iotype >= NR_PAGE_TYPE) { > > f2fs_bug_on(sbi, iotype != META_FLUSH); > > iotype = META; > > } > > For normal , only META_FLUSH will be greater than NR_PAGE_TYPE, > the

Re: [f2fs-dev] [PATCH v2] f2fs: retry to update the inode page given EIO

2023-01-12 Thread Jaegeuk Kim
On 01/12, Chao Yu wrote: > On 2023/1/12 2:50, Jaegeuk Kim wrote: > > On 01/11, Chao Yu wrote: > > > On 2023/1/11 9:20, Jaegeuk Kim wrote: > > > > In f2fs_update_inode_page, f2fs_get_node_page handles EIO along with > > > > f2fs_handle_page_eio that

Re: [f2fs-dev] [PATCH 1/4] f2fs: reset iostat_count in f2fs_reset_iostat()

2023-01-12 Thread Jaegeuk Kim
On 01/12, Yangtao Li wrote: > Dear Jaegeuk, > > > Hi Yangtao, > > > > These are all in dev-test branch, which means you don't need to stack up > > more > > patches on top of it. I just integrated most of them into two original > > patches. > > Ok, I'll merge the previous commits and resend nex

Re: [f2fs-dev] [PATCH 1/4] f2fs: reset iostat_count in f2fs_reset_iostat()

2023-01-11 Thread Jaegeuk Kim
On 01/11, Chao Yu wrote: > On 2023/1/5 3:20, Jaegeuk Kim wrote: > > Hi Yangtao, > > > > These are all in dev-test branch, which means you don't need to stack up > > more > > patches on top of it. I just integrated most of them into two original > >

Re: [f2fs-dev] [PATCH v3] f2fs: retry to update the inode page given EIO

2023-01-11 Thread Jaegeuk Kim
ned-off-by: Jaegeuk Kim --- Change log from v2: - set EIO to cover the case of data corruption given by buggy UFS driver fs/f2fs/inode.c | 2 +- fs/f2fs/node.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index ff6cf66ed46b..2ed7a621f

Re: [f2fs-dev] [PATCH v2] f2fs: retry to update the inode page given EIO

2023-01-11 Thread Jaegeuk Kim
On 01/11, Chao Yu wrote: > On 2023/1/11 9:20, Jaegeuk Kim wrote: > > In f2fs_update_inode_page, f2fs_get_node_page handles EIO along with > > f2fs_handle_page_eio that stops checkpoint, if the disk couldn't be > > recovered. > > As a result, we don't nee

Re: [f2fs-dev] [PATCH v2] f2fs: retry to update the inode page given EIO

2023-01-10 Thread Jaegeuk Kim
ned-off-by: Jaegeuk Kim --- Change log from v1: - fix a bug fs/f2fs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index ff6cf66ed46b..2ed7a621fdf1 100644 --- a/fs/f2fs/inode.c +++ b/fs/f2fs/inode.c @@ -719,7 +719

[f2fs-dev] [PATCH] f2fs: retry to update the inode page given EIO

2023-01-05 Thread Jaegeuk Kim
ned-off-by: Jaegeuk Kim --- fs/f2fs/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index 01b9e6f85f6b..66e407fcefd3 100644 --- a/fs/f2fs/inode.c +++ b/fs/f2fs/inode.c @@ -719,10 +719,10 @@ void f2fs_update_inode_page(struct in

Re: [f2fs-dev] [PATCH 1/4] f2fs: reset iostat_count in f2fs_reset_iostat()

2023-01-04 Thread Jaegeuk Kim
Hi Yangtao, These are all in dev-test branch, which means you don't need to stack up more patches on top of it. I just integrated most of them into two original patches. Could you please take a look at this? c1706cc0cd72 f2fs: add iostat support for flush acd6f525e01c f2fs: support accounting ios

[f2fs-dev] [GIT PULL] f2fs fix for 6.2-rc3

2023-01-04 Thread Jaegeuk Kim
6.2-rc1, which reported a wrong age information in extent_cache. - fix a kernel panic if extent_tree was not created, which was caught by a wrong BUG_ON. Chao Yu (1): f2fs: fix to avoid NULL pointer dereference in f2fs_issue_f

Re: [f2fs-dev] [PATCH] f2fs: don't set FI_COMPRESS_RELEASED if file is not compressed

2023-01-03 Thread Jaegeuk Kim
mpress_file()' is called. > > On Mon, Dec 12, 2022 at 03:05:08PM -0800, Jaegeuk Kim wrote: > > > On 12/12, zhoudan wrote: > > > > Maybe I'm not describing it clearly enough, but I think there is > > > > something wrong with the logic here.The

Re: [f2fs-dev] [PATCH] f2fs: introduce hot_data_age_threshold and warm_data_age_threshold mount opt

2023-01-03 Thread Jaegeuk Kim
On 12/06, Yangtao Li wrote: > This patch supports parsing these two parameters from mount opt, > so that we don't have to dynamically modify the parameters through > the sysfs node after the system starts. It seems sysfs would be enough? > > Signed-off-by: Yangtao Li > --- > Documentation/file

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