Re: [f2fs-dev] [PATCH] f2fs: fix to avoid potential deadlock

2022-01-27 Thread Jaegeuk Kim
On 01/27, Chao Yu wrote: > Quoted from Jing Xia's report, there is a potential deadlock may happen > between kworker and checkpoint as below: > > [T:writeback] [T:checkpoint] > - wb_writeback > - blk_start_plug > bio contains NodeA was plugged in writeback threads I'm

[f2fs-dev] [PATCH] f2fs: add a way to limit roll forward recovery time

2022-01-27 Thread Jaegeuk Kim
This adds a sysfs entry to call checkpoint during fsync() in order to avoid long elapsed time to run roll-forward recovery when booting the device. Signed-off-by: Jaegeuk Kim --- Documentation/ABI/testing/sysfs-fs-f2fs | 6 ++ fs/f2fs/checkpoint.c| 1 + fs/f2fs/f2fs.h

[f2fs-dev] [PATCH 1/2] f2fs: move discard parameters into discard_cmd_control

2022-01-25 Thread Jaegeuk Kim
-by: Konstantin Vyshetsky Signed-off-by: Jaegeuk Kim --- fs/f2fs/f2fs.h| 4 fs/f2fs/segment.c | 22 +- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 8178a9152e49..63c90416364b 100644 --- a/fs/f2fs/f2fs.h +++ b/fs

[f2fs-dev] [PATCH 2/2] f2fs: expose discard related parameters in sysfs

2022-01-25 Thread Jaegeuk Kim
From: Konstantin Vyshetsky This patch exposes max_discard_request, min_discard_issue_time, mid_discard_issue_time, and max_discard_issue_time in sysfs. This will allow the user to fine tune discard operations. Signed-off-by: Konstantin Vyshetsky Signed-off-by: Jaegeuk Kim --- Documentation

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

2022-01-18 Thread Jaegeuk Kim
pages Hyeong-Jun Kim (1): f2fs: compress: fix potential deadlock of compress file Jaegeuk Kim (8): f2fs: do not expose unwritten blocks to user by DIO f2fs: show more DIO information in tracepoint f2fs: show number of pending discard commands f2fs: avoid duplicate

[f2fs-dev] [PATCH] mkfs.f2fs: set required quota types only

2022-01-13 Thread Jaegeuk Kim
: enables usr/grp 5) -g android -O project_quota -O extra_attr : enables usr/grp/proj Signed-off-by: Jaegeuk Kim --- include/f2fs_fs.h | 1 + mkfs/f2fs_format.c | 37 ++--- mkfs/f2fs_format_main.c | 9 + 3 files changed, 24 insertions(+), 23

Re: [f2fs-dev] [PATCH] f2fs: move f2fs to use reader-unfair rwsems

2022-01-11 Thread Jaegeuk Kim
On 01/11, Waiman Long wrote: > On 1/11/22 12:07, Jaegeuk Kim wrote: > > On 01/11, Waiman Long wrote: > > > On 1/11/22 01:53, Tim Murray wrote: > > > > On Mon, Jan 10, 2022 at 8:15 PM Waiman Long wrote: > > > > > That is not how rwsem works. A reader

Re: [f2fs-dev] [PATCH] f2fs: move f2fs to use reader-unfair rwsems

2022-01-11 Thread Jaegeuk Kim
On 01/11, Waiman Long wrote: > > On 1/11/22 01:53, Tim Murray wrote: > > On Mon, Jan 10, 2022 at 8:15 PM Waiman Long wrote: > > > That is not how rwsem works. A reader which fails to get the lock > > > because it is write-locked will remove its reader count before going to > > > sleep. So the

[f2fs-dev] [PATCH] f2fs: move f2fs to use reader-unfair rwsems

2022-01-08 Thread Jaegeuk Kim
the read lock and a second acquisition of the write lock that might be blocking high priority work. Signed-off-by: Tim Murray Signed-off-by: Jaegeuk Kim --- fs/f2fs/checkpoint.c | 34 ++--- fs/f2fs/compress.c | 6 +-- fs/f2fs/data.c | 50 +-- fs/f2fs/dir.c

[f2fs-dev] [PATCH] f2fs: do not allow partial truncation on pinned file

2022-01-08 Thread Jaegeuk Kim
If the pinned file has a hole by partial truncation, application that has the block map will be broken. Signed-off-by: Jaegeuk Kim --- fs/f2fs/file.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index f39feedc9816..6ccdd6e347e2 100644

Re: [f2fs-dev] [PATCH 3/6] f2fs: do not expose unwritten blocks to user by DIO

2022-01-07 Thread Jaegeuk Kim
On 01/07, Eric Biggers wrote: > On Fri, Jan 07, 2022 at 05:52:48PM -0800, Jaegeuk Kim wrote: > > On 01/07, Eric Biggers wrote: > > > Hi Jaegeuk, > > > > > > On Tue, Jan 04, 2022 at 01:24:16PM -0800, Jaegeuk Kim wrote: > > > > DIO preallocates phys

Re: [f2fs-dev] [PATCH 3/6] f2fs: do not expose unwritten blocks to user by DIO

2022-01-07 Thread Jaegeuk Kim
On 01/07, Eric Biggers wrote: > Hi Jaegeuk, > > On Tue, Jan 04, 2022 at 01:24:16PM -0800, Jaegeuk Kim wrote: > > DIO preallocates physical blocks before writing data, but if an error > > occurrs > > or power-cut happens, we can see block contents from the disk. This

Re: [f2fs-dev] [PATCH] fsck.f2fs: Add progression feedback

2022-01-06 Thread Jaegeuk Kim
Hi Antonie, I actually took a look at the patch yesterday and tested a bit to avoid too many messages. Could you please check this out? https://github.com/jaegeuk/f2fs-tools/commit/45b3c75ac3c07d444180a3598f0d48c80abe9934 On 01/06, Chao Yu wrote: > On 2022/1/6 23:33, Antoine Viallon wrote: > >

Re: [f2fs-dev] [PATCH 5/6] f2fs: implement iomap operations

2022-01-05 Thread Jaegeuk Kim
On 01/05, Chao Yu wrote: > On 2022/1/5 5:24, Jaegeuk Kim wrote: > > From: Eric Biggers > > > > Implement 'struct iomap_ops' for f2fs, in preparation for making f2fs > > use iomap for direct I/O. > > > > Note that this may be used for other things beside

Re: [f2fs-dev] [PATCH 3/6] f2fs: do not expose unwritten blocks to user by DIO

2022-01-05 Thread Jaegeuk Kim
On 01/05, Chao Yu wrote: > On 2022/1/5 5:24, Jaegeuk Kim wrote: > > DIO preallocates physical blocks before writing data, but if an error > > occurrs > > or power-cut happens, we can see block contents from the disk. This patch > > tries > > to fix it by 1) t

[f2fs-dev] [PATCH 2/6] f2fs: reduce indentation in f2fs_file_write_iter()

2022-01-04 Thread Jaegeuk Kim
From: Eric Biggers Replace 'if (ret > 0)' with 'if (ret <= 0) goto out_unlock;'. No change in behavior. Signed-off-by: Eric Biggers Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim --- fs/f2fs/file.c | 64 +++--- 1 file changed, 34 inse

[f2fs-dev] [PATCH 5/6] f2fs: implement iomap operations

2022-01-04 Thread Jaegeuk Kim
-by: Jaegeuk Kim --- fs/f2fs/Kconfig | 1 + fs/f2fs/data.c | 56 + fs/f2fs/f2fs.h | 1 + 3 files changed, 58 insertions(+) diff --git a/fs/f2fs/Kconfig b/fs/f2fs/Kconfig index 7eea3cfd894d..f46a7339d6cf 100644 --- a/fs/f2fs/Kconfig +++ b/fs/f2fs/Kconfig

[f2fs-dev] [PATCH 4/6] f2fs: fix the f2fs_file_write_iter tracepoint

2022-01-04 Thread Jaegeuk Kim
Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim --- fs/f2fs/file.c | 5 +++-- include/trace/events/f2fs.h | 12 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index e1445cf915ea..048db4852b28 100644 --- a/fs/f2fs/file.c +++ b

[f2fs-dev] [PATCH 6/6] f2fs: use iomap for direct I/O

2022-01-04 Thread Jaegeuk Kim
were seen. (Some tests fail both before and after. generic/017 hangs both before and after, so it had to be excluded.) Signed-off-by: Eric Biggers [Jaegeuk Kim: use spin_lock_bh for f2fs_update_iostat in softirq] Signed-off-by: Jaegeuk Kim --- fs/f2fs/data.c | 205

[f2fs-dev] [PATCH 1/6] f2fs: rework write preallocations

2022-01-04 Thread Jaegeuk Kim
the logic that was previously in write_iter() directly. Signed-off-by: Eric Biggers Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim --- fs/f2fs/data.c | 55 ++--- fs/f2fs/f2fs.h | 3 +- fs/f2fs/file.c | 131 +++-- 3 files changed, 88

[f2fs-dev] [PATCH 3/6] f2fs: do not expose unwritten blocks to user by DIO

2022-01-04 Thread Jaegeuk Kim
-by: Jaegeuk Kim --- fs/f2fs/data.c | 5 - fs/f2fs/f2fs.h | 5 + fs/f2fs/file.c | 27 ++- fs/f2fs/inode.c | 8 4 files changed, 35 insertions(+), 10 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 3db0f3049b90..9c867de1ec29 100644 --- a/fs/f2fs

Re: [f2fs-dev] [PATCH 5/6] f2fs: implement iomap operations

2022-01-04 Thread Jaegeuk Kim
On 12/30, Chao Yu wrote: > On 2021/12/3 5:28, Jaegeuk Kim wrote: > > On 12/02, Jaegeuk Kim wrote: > > > On 12/02, Eric Biggers wrote: > > > > On Thu, Dec 02, 2021 at 11:00:47AM -0800, Jaegeuk Kim wrote: > > > > > On 12/02, Jaegeuk Kim wr

Re: [f2fs-dev] [PATCH 1/2] f2fs: avoid down_write on nat_tree_lock during checkpoint

2021-12-20 Thread Jaegeuk Kim
On 12/19, Chao Yu wrote: > On 2021/12/15 2:24, Jaegeuk Kim wrote: > > Let's cache nat entry if there's no lock contention only. > > > > Signed-off-by: Jaegeuk Kim > > --- > > fs/f2fs/node.c | 4 > > 1 file changed, 4 insertions(+) > > >

Re: [f2fs-dev] [PATCH Vx 1/1] f2fs: Avoid deadlock between writeback and checkpoint

2021-12-17 Thread Jaegeuk Kim
On 12/17, Chao Yu wrote: > On 2021/11/20 9:50, Chao Yu wrote: > > On 2021/11/18 14:46, Chao Yu wrote: > > > On 2021/11/18 0:56, Jaegeuk Kim wrote: > > > > On 11/09, niuzhigu...@gmail.com wrote: > > > > > From: Zhiguo Niu > > >

Re: [f2fs-dev] [PATCH -next] f2fs: Simplify bool conversion

2021-12-17 Thread Jaegeuk Kim
On 12/17, Chao Yu wrote: > On 2021/12/15 10:38, Yang Li wrote: > > Fix the following coccicheck warning: > > ./fs/f2fs/sysfs.c:491:41-46: WARNING: conversion to bool not needed here > > > > Reported-by: Abaci Robot > > Signed-off-by: Yang Li > > Thanks for fixing this issue, do you mind

Re: [f2fs-dev] 回复:[PATCH -next] f2fs: Simplify bool conversion

2021-12-17 Thread Jaegeuk Kim
t allow auto casting as well. > > > ---------- > 发件人:Jaegeuk Kim > 发送时间:2021年12月17日(星期五) 03:27 > 收件人:Yang Li > 抄 送:chao ; linux-f2fs-devel > ; linux-kernel > ; Abaci Robot > 主 题:Re: [PATCH -next] f2fs: Simplify bool conversion > > O

Re: [f2fs-dev] [PATCH Vx 1/1] f2fs: Avoid deadlock between writeback and checkpoint

2021-12-17 Thread Jaegeuk Kim
>*/3456 > <http://172.29.60.15:8083/xref/sprdroidr_trunk/bsp/kernel/kernel4.14/block/blk-core.c#3456> > *if* (tsk > <http://172.29.60.15:8083/xref/sprdroidr_trunk/bsp/kernel/kernel4.14/block/blk-core.c#tsk>->plug > <http://172.29.60.15:8083/s?defs=

Re: [f2fs-dev] [PATCH Vx 1/1] f2fs: Avoid deadlock between writeback and checkpoint

2021-12-16 Thread Jaegeuk Kim
On 12/14, Jaegeuk Kim wrote: > On 12/03, Chao Yu wrote: > > On 2021/12/3 2:15, Jaegeuk Kim wrote: > > > On 12/02, Chao Yu wrote: > > > > On 2021/12/2 6:20, Jaegeuk Kim wrote: > > > > > On 11/20, Chao Yu wrote: > > > > > > On 20

Re: [f2fs-dev] [PATCH v2] f2fs: don't drop compressed page cache in .{invalidate, release}page

2021-12-16 Thread Jaegeuk Kim
On 12/16, Chao Yu wrote: > For compressed inode, in .{invalidate,release}page, we will call > f2fs_invalidate_compress_pages() to drop all compressed page cache of > current inode. > > But we don't need to drop compressed page cache synchronously in > .invalidatepage, because, all trancation

Re: [f2fs-dev] [PATCH -next] f2fs: Simplify bool conversion

2021-12-16 Thread Jaegeuk Kim
On 12/15, Yang Li wrote: > Fix the following coccicheck warning: > ./fs/f2fs/sysfs.c:491:41-46: WARNING: conversion to bool not needed here > > Reported-by: Abaci Robot > Signed-off-by: Yang Li > --- > fs/f2fs/sysfs.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git

Re: [f2fs-dev] [PATCH v3] f2fs: fix to reserve space for IO align feature

2021-12-16 Thread Jaegeuk Kim
On 12/16, Chao Yu wrote: > On 2021/12/11 21:27, Chao Yu wrote: > > https://bugzilla.kernel.org/show_bug.cgi?id=204137 > > > > With below script, we will hit panic during new segment allocation: > > > > DISK=bingo.img > > MOUNT_DIR=/mnt/f2fs > > > > dd if=/dev/zero of=$DISK bs=1M count=105 > >

Re: [f2fs-dev] [PATCH Vx 1/1] f2fs: Avoid deadlock between writeback and checkpoint

2021-12-14 Thread Jaegeuk Kim
On 12/03, Chao Yu wrote: > On 2021/12/3 2:15, Jaegeuk Kim wrote: > > On 12/02, Chao Yu wrote: > > > On 2021/12/2 6:20, Jaegeuk Kim wrote: > > > > On 11/20, Chao Yu wrote: > > > > > On 2021/11/18 14:46, Chao Yu wrote: > > > > > >

Re: [f2fs-dev] [PATCH] f2fs: skip f2fs_preallocate_blocks() for overwrite case

2021-12-14 Thread Jaegeuk Kim
On 12/12, Chao Yu wrote: > Ping, > > On 2021/10/30 11:02, Chao Yu wrote: > > On 2021/10/30 1:43, Jaegeuk Kim wrote: > > > On 10/29, Chao Yu wrote: > > > > Ping, > > > > > > > > On 2021/9/29 8:05, Chao Yu wrote: > > > > >

[f2fs-dev] [PATCH 1/2] f2fs: avoid down_write on nat_tree_lock during checkpoint

2021-12-14 Thread Jaegeuk Kim
Let's cache nat entry if there's no lock contention only. Signed-off-by: Jaegeuk Kim --- fs/f2fs/node.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 556fcd8457f3..b1bc7d76da3b 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -430,6 +430,10

[f2fs-dev] [PATCH 2/2] f2fs: do not bother checkpoint by f2fs_get_node_info

2021-12-14 Thread Jaegeuk Kim
This patch tries to mitigate lock contention between f2fs_write_checkpoint and f2fs_get_node_info along with nat_tree_lock. The idea is, if checkpoint is currently running, other threads that try to grab nat_tree_lock would be better to wait for checkpoint. Signed-off-by: Jaegeuk Kim --- fs

Re: [f2fs-dev] [PATCH 6/6] f2fs: use iomap for direct I/O

2021-12-10 Thread Jaegeuk Kim
On 11/16, Jaegeuk Kim wrote: > From: Eric Biggers > > Make f2fs_file_read_iter() and f2fs_file_write_iter() use the iomap > direct I/O implementation instead of the fs/direct-io.c one. > > The iomap implementation is more efficient, and it also avoids the need >

[f2fs-dev] [PATCH] f2fs: avoid EINVAL by SBI_NEED_FSCK when pinning a file

2021-12-09 Thread Jaegeuk Kim
Android OTA failed due to SBI_NEED_FSCK flag when pinning the file. Let's avoid it since we can do in-place-updates. Signed-off-by: Jaegeuk Kim Change-Id: I3fd33c984417c10b38e23de6cec017b03d588945 --- fs/f2fs/data.c | 7 +-- fs/f2fs/file.c | 10 +- 2 files changed, 10 insertions

Re: [f2fs-dev] [syzbot] BUG: unable to handle kernel NULL pointer dereference in folio_mark_dirty

2021-12-07 Thread Jaegeuk Kim
On 12/07, Matthew Wilcox wrote: > On Tue, Dec 07, 2021 at 01:39:06PM -0800, Jaegeuk Kim wrote: > > On 12/07, Matthew Wilcox wrote: > > > > > Call Trace: > > > > > > > > > > folio_mark_dirty+0x136/0x270 mm/page-wr

Re: [f2fs-dev] Multi device fs and udev

2021-12-07 Thread Jaegeuk Kim
On 12/05, Ananth Bhaskararaman wrote: > I have a multi-disk f2fs device, and when I run lsblk, it shows the fs > only on the main device. > I'd like all devices to show up with the mounted fs like btrfs > multi-device arrays. > I'd also like udev to recognise that both devices are used by this fs.

Re: [f2fs-dev] [syzbot] BUG: unable to handle kernel NULL pointer dereference in folio_mark_dirty

2021-12-07 Thread Jaegeuk Kim
On 12/07, Matthew Wilcox wrote: > On Mon, Dec 06, 2021 at 05:56:31PM -0800, Andrew Morton wrote: > > On Sat, 04 Dec 2021 01:55:17 -0800 syzbot > > wrote: > > > > > Hello, > > > > > > syzbot found the following issue on: > > > > > > HEAD commit:58e1100fdc59 MAINTAINERS: co-maintain

[f2fs-dev] [PATCH] f2fs: avoid duplicate call of mark_inode_dirty

2021-12-04 Thread Jaegeuk Kim
Let's check the condition first before set|clear bit. Signed-off-by: Jaegeuk Kim --- fs/f2fs/f2fs.h | 4 1 file changed, 4 insertions(+) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index ac6dda6c4c5a..cbc73bd71dad 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -3115,12 +3115,16

Re: [f2fs-dev] [PATCH 2/6 v2] f2fs: do not expose unwritten blocks to user by DIO

2021-12-04 Thread Jaegeuk Kim
-by: Jaegeuk Kim --- Change log from v1: - fix quota xfstests failure - cover missing case fs/f2fs/data.c | 5 - fs/f2fs/f2fs.h | 5 + fs/f2fs/file.c | 27 ++- fs/f2fs/inode.c | 8 4 files changed, 35 insertions(+), 10 deletions(-) diff --git a/fs/f2fs

Re: [f2fs-dev] [PATCH 2/6] f2fs: do not expose unwritten blocks to user by DIO

2021-12-03 Thread Jaegeuk Kim
On 12/03, Chao Yu wrote: > On 2021/12/3 2:13, Jaegeuk Kim wrote: > > On 12/02, Chao Yu wrote: > > > On 2021/11/17 5:45, Jaegeuk Kim wrote: > > > > DIO preallocates physical blocks before writing data, but if an error > > > > occurrs > > > >

Re: [f2fs-dev] [PATCH 5/6] f2fs: implement iomap operations

2021-12-02 Thread Jaegeuk Kim
On 12/02, Jaegeuk Kim wrote: > On 12/02, Eric Biggers wrote: > > On Thu, Dec 02, 2021 at 11:00:47AM -0800, Jaegeuk Kim wrote: > > > On 12/02, Jaegeuk Kim wrote: > > > > On 12/02, Eric Biggers wrote: > > > > > On Thu, Dec 02, 2021 at 10:04:11PM +0800,

Re: [f2fs-dev] [PATCH 5/6] f2fs: implement iomap operations

2021-12-02 Thread Jaegeuk Kim
On 12/02, Eric Biggers wrote: > On Thu, Dec 02, 2021 at 11:00:47AM -0800, Jaegeuk Kim wrote: > > On 12/02, Jaegeuk Kim wrote: > > > On 12/02, Eric Biggers wrote: > > > > On Thu, Dec 02, 2021 at 10:04:11PM +0800, Chao Yu wrote: > > > > > On 2021/12/2

Re: [f2fs-dev] [PATCH 5/6] f2fs: implement iomap operations

2021-12-02 Thread Jaegeuk Kim
On 12/02, Jaegeuk Kim wrote: > On 12/02, Eric Biggers wrote: > > On Thu, Dec 02, 2021 at 10:04:11PM +0800, Chao Yu wrote: > > > On 2021/12/2 12:15, Eric Biggers wrote: > > > > On Thu, Dec 02, 2021 at 11:10:41AM +0800, Chao Yu wrote: > > > > > Why not

Re: [f2fs-dev] [PATCH 5/6] f2fs: implement iomap operations

2021-12-02 Thread Jaegeuk Kim
On 12/02, Eric Biggers wrote: > On Thu, Dec 02, 2021 at 10:04:11PM +0800, Chao Yu wrote: > > On 2021/12/2 12:15, Eric Biggers wrote: > > > On Thu, Dec 02, 2021 at 11:10:41AM +0800, Chao Yu wrote: > > > > Why not relocating this check before f2fs_map_blocks()? > > > > Wait, it supports DIO in

Re: [f2fs-dev] [PATCH Vx 1/1] f2fs: Avoid deadlock between writeback and checkpoint

2021-12-02 Thread Jaegeuk Kim
On 12/02, Chao Yu wrote: > On 2021/12/2 6:20, Jaegeuk Kim wrote: > > On 11/20, Chao Yu wrote: > > > On 2021/11/18 14:46, Chao Yu wrote: > > > > On 2021/11/18 0:56, Jaegeuk Kim wrote: > > > > > On 11/09, niuzhigu...@gmail.com wrote: > > > > &

Re: [f2fs-dev] [PATCH 2/6] f2fs: do not expose unwritten blocks to user by DIO

2021-12-02 Thread Jaegeuk Kim
On 12/02, Chao Yu wrote: > On 2021/11/17 5:45, Jaegeuk Kim wrote: > > DIO preallocates physical blocks before writing data, but if an error > > occurrs > > or power-cut happens, we can see block contents from the disk. This patch > > tries > > to fix it by 1) t

Re: [f2fs-dev] [PATCH Vx 1/1] f2fs: Avoid deadlock between writeback and checkpoint

2021-12-01 Thread Jaegeuk Kim
On 11/20, Chao Yu wrote: > On 2021/11/18 14:46, Chao Yu wrote: > > On 2021/11/18 0:56, Jaegeuk Kim wrote: > > > On 11/09, niuzhigu...@gmail.com wrote: > > > > From: Zhiguo Niu > > > > > > > > There could be a scenario as following: > &

[f2fs-dev] [PATCH] f2fs: show number of pending discard commands

2021-11-29 Thread Jaegeuk Kim
This information can be used to check how much time we need to give to issue all the discard commands. Signed-off-by: Jaegeuk Kim --- Documentation/ABI/testing/sysfs-fs-f2fs | 5 + fs/f2fs/sysfs.c | 11 +++ 2 files changed, 16 insertions(+) diff --git

[f2fs-dev] [PATCH] f2fs: show more DIO information in tracepoint

2021-11-19 Thread Jaegeuk Kim
This prints more information of DIO in tracepoint. Signed-off-by: Jaegeuk Kim --- fs/f2fs/file.c | 4 ++-- include/trace/events/f2fs.h | 15 +-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 32c0bd545c5c

Re: [f2fs-dev] [PATCH 2/6] f2fs: do not expose unwritten blocks to user by DIO

2021-11-17 Thread Jaegeuk Kim
On 11/17, Chao Yu wrote: > On 2021/11/17 5:45, Jaegeuk Kim wrote: > > DIO preallocates physical blocks before writing data, but if an error > > occurrs > > or power-cut happens, we can see block contents from the disk. This patch > > tries > > to fix it by 1) t

Re: [f2fs-dev] [PATCH 1/6] f2fs: rework write preallocations

2021-11-17 Thread Jaegeuk Kim
On 11/17, Chao Yu wrote: > On 2021/11/17 5:45, Jaegeuk Kim wrote: > > From: Eric Biggers > > > > f2fs_write_begin() assumes that all blocks were preallocated by > > default unless FI_NO_PREALLOC is explicitly set. This invites data > > corruption, as there

Re: [f2fs-dev] [PATCH Vx 1/1] f2fs: Avoid deadlock between writeback and checkpoint

2021-11-17 Thread Jaegeuk Kim
On 11/09, niuzhigu...@gmail.com wrote: > From: Zhiguo Niu > > There could be a scenario as following: > The inodeA and inodeB are in b_io queue of writeback > inodeA : f2fs's node inode > inodeB : a dir inode with only one dirty pages, and the node page > of inodeB cached into inodeA > >

[f2fs-dev] [PATCH 5/6] f2fs: implement iomap operations

2021-11-16 Thread Jaegeuk Kim
-by: Jaegeuk Kim --- fs/f2fs/Kconfig | 1 + fs/f2fs/data.c | 58 + fs/f2fs/f2fs.h | 1 + 3 files changed, 60 insertions(+) diff --git a/fs/f2fs/Kconfig b/fs/f2fs/Kconfig index 7eea3cfd894d..f46a7339d6cf 100644 --- a/fs/f2fs/Kconfig +++ b/fs/f2fs/Kconfig

[f2fs-dev] [PATCH 4/6] f2fs: fix the f2fs_file_write_iter tracepoint

2021-11-16 Thread Jaegeuk Kim
Signed-off-by: Jaegeuk Kim --- fs/f2fs/file.c | 5 +++-- include/trace/events/f2fs.h | 12 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index fdc440d212c3..709fa893d832 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c

[f2fs-dev] [PATCH 1/6] f2fs: rework write preallocations

2021-11-16 Thread Jaegeuk Kim
the logic that was previously in write_iter() directly. Jaegeuk: DIO to holes are turning into buffered IO in f2fs_direct_IO, so we should not preallocate blocks. Signed-off-by: Eric Biggers Signed-off-by: Jaegeuk Kim --- fs/f2fs/data.c | 55 ++--- fs/f2fs/f2fs.h | 3 +- fs/f

[f2fs-dev] [PATCH 3/6] f2fs: reduce indentation in f2fs_file_write_iter()

2021-11-16 Thread Jaegeuk Kim
From: Eric Biggers Replace 'if (ret > 0)' with 'if (ret <= 0) goto out_unlock;'. No change in behavior. Signed-off-by: Eric Biggers Signed-off-by: Jaegeuk Kim --- fs/f2fs/file.c | 69 ++ 1 file changed, 36 insertions(+), 33 deletions(-)

[f2fs-dev] [PATCH 6/6] f2fs: use iomap for direct I/O

2021-11-16 Thread Jaegeuk Kim
were seen. (Some tests fail both before and after. generic/017 hangs both before and after, so it had to be excluded.) Signed-off-by: Eric Biggers Signed-off-by: Jaegeuk Kim --- fs/f2fs/data.c | 205 +--- fs/f2fs/f2fs.h | 8 +- fs/f2fs/file.c | 343

[f2fs-dev] [PATCH 2/6] f2fs: do not expose unwritten blocks to user by DIO

2021-11-16 Thread Jaegeuk Kim
-by: Jaegeuk Kim --- fs/f2fs/data.c | 5 - fs/f2fs/f2fs.h | 5 + fs/f2fs/file.c | 24 +++- 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 3b27fb7daa8b..7ac1a39fcad2 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c

[f2fs-dev] [PATCH] fsck.f2fs: do not assert if i_size is missing i_blocks in symlink

2021-11-12 Thread Jaegeuk Kim
This case is not a bug, so we should fix seamlessly. Signed-off-by: Jaegeuk Kim --- fsck/fsck.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/fsck/fsck.c b/fsck/fsck.c index 0619519f9b42..ecd87af0ff7f 100644 --- a/fsck/fsck.c +++ b/fsck/fsck.c @@ -1131,14

Re: [f2fs-dev] [GIT PULL] f2fs update for 5.16-rc1

2021-11-11 Thread Jaegeuk Kim
nstead we do get new direct I/O features? No worries. I'm working on the fix and will apply the Eric's patches on top of this change. > > On Wed, Nov 10, 2021 at 08:11:10PM -0800, Jaegeuk Kim wrote: > > Hi Linus, > > > > Could you please consider this pull request? >

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

2021-11-10 Thread Jaegeuk Kim
reduce compress ratio unproperly Gao Xiang (1): f2fs: fix up f2fs_lookup tracepoints Hyeong-Jun Kim (2): f2fs: compress: disallow disabling compress on non-empty compressed file f2fs: invalidate META_MAPPING before IPU/DIO write Jaegeuk Kim (1): f2fs: should use GFP_NOFS

Re: [f2fs-dev] [PATCH] f2fs: provide a way to attach HIPRI for Direct IO

2021-11-10 Thread Jaegeuk Kim
On 11/09, Jens Axboe wrote: > On 11/9/21 9:39 AM, Christoph Hellwig wrote: > > On Mon, Nov 08, 2021 at 06:13:36PM -0800, Jaegeuk Kim wrote: > >> This patch adds a way to attach HIPRI by expanding the existing sysfs's > >> data_io_flag. User can measure IO performance b

[f2fs-dev] [PATCH] f2fs: provide a way to attach HIPRI for Direct IO

2021-11-08 Thread Jaegeuk Kim
This patch adds a way to attach HIPRI by expanding the existing sysfs's data_io_flag. User can measure IO performance by enabling it. Signed-off-by: Jaegeuk Kim --- Documentation/ABI/testing/sysfs-fs-f2fs | 16 +--- fs/f2fs/data.c | 2 ++ fs/f2fs/f2fs.h

Re: [f2fs-dev] [PATCH] f2fs: skip f2fs_preallocate_blocks() for overwrite case

2021-10-29 Thread Jaegeuk Kim
On 10/29, Chao Yu wrote: > Ping, > > On 2021/9/29 8:05, Chao Yu wrote: > > On 2021/9/29 3:08, Jaegeuk Kim wrote: > > > On 09/28, Chao Yu wrote: > > > > In f2fs_file_write_iter(), let's use f2fs_overwrite_io() to > > > > check whethere

Re: [f2fs-dev] [PATCH] f2fs: fix incorrect return value in f2fs_sanity_check_ckpt()

2021-10-27 Thread Jaegeuk Kim
Could you post the patch again? I don't see this in my box. On 10/27, Chao Yu wrote: > Jaegeuk, > > Missed to apply this patch? > > Thanks, > > On 2021/9/24 17:50, Pavel Machek wrote: > > Hi! > > > > > This code looks quite confused: part of function returns 1 on > > > corruption, part

Re: [f2fs-dev] [PATCH] f2fs: include non-compressed blocks in compr_written_block

2021-10-21 Thread Jaegeuk Kim
On 10/21, Daeho Jeong wrote: > > Okay, shouldn't we Cc stable mailing list for this patch? otherwise > > userspace tool may get different stat number with the same compressed > > file in different kernel? > > > > Oh, could you let me know what the address of the "stable" mailing list is? Added

Re: [f2fs-dev] [PATCH v5 1/2] f2fs: separate buffer and direct io in block allocation statistics

2021-10-19 Thread Jaegeuk Kim
On 10/09, Fengnan Chang wrote: > separate buffer and direct io in block allocation statistics. > > New output will like this: >buffer direct segments > IPU:0 0N/A > SSR:0 0 0 > LFS:0 0 0 >

Re: [f2fs-dev] [PATCH] f2fs-tools: fall back to the original version check when clock_gettime is not supported

2021-09-28 Thread Jaegeuk Kim
Merged to address android build breakage. On 09/28, Daeho Jeong wrote: > From: Daeho Jeong > > In lower versions than macOS 10.12, they don't support clock_gettime > function. It breaks the build, so we need to fall back to the original > kernel version check algorithm, in that case. > >

Re: [f2fs-dev] [PATCH] f2fs: skip f2fs_preallocate_blocks() for overwrite case

2021-09-28 Thread Jaegeuk Kim
On 09/28, Chao Yu wrote: > In f2fs_file_write_iter(), let's use f2fs_overwrite_io() to > check whethere it is overwrite case, for such case, we can skip > f2fs_preallocate_blocks() in order to avoid f2fs_do_map_lock(), > which may be blocked by checkpoint() potentially. > > Signed-off-by: Chao Yu

Re: [f2fs-dev] [PATCH] f2fs: fix whint_mode mount option error

2021-09-28 Thread Jaegeuk Kim
On 09/28, Chao Yu wrote: > On 2021/9/27 14:09, Fengnan Chang wrote: > > When mount with whint_mode option, it doesn't work, Fix it. > > Fixes: d0b9e42ab615 (f2fs: introduce inmem curseg) > > Thanks for the patch, it looks Keoseong Park has submitted the same > fix patch a little bit earlier >

Re: [f2fs-dev] [PATCH] mkfs.f2fs: wipe other FS magics given -f

2021-09-20 Thread Jaegeuk Kim
On 09/15, Shinichiro Kawasaki wrote: > On Sep 10, 2021 / 15:56, Jaegeuk Kim wrote: > > This patch fixes the below stale magic info. > > > > $ mkfs.btrfs -f test.img > > btrfs-progs v5.10.1 > > See http://btrfs.wiki.kernel.org for more information. > >

Re: [f2fs-dev] [PATCH v2] mkfs.f2fs: wipe other FS magics given -f

2021-09-20 Thread Jaegeuk Kim
....| * 00010080 Signed-off-by: Jaegeuk Kim --- Change log from v1: - add error handlers - call f2fs_devs_are_umounted() followed by f2fs_get_device_info() to fix open(O_EXCL) fsck/main.c | 2 +- include/f2fs_fs.h | 1 + lib/libf2fs.c | 6

Re: [f2fs-dev] [PATCH v4] f2fs: introduce fragment allocation mode mount option

2021-09-20 Thread Jaegeuk Kim
On 09/12, Chao Yu wrote: > On 2021/9/11 7:13, Jaegeuk Kim wrote: > > Wait. Why do we need to add so many options here? I was expecting to see > > performance difference when getting random segments or random blocks as > > an extreme case. I don't get the point why we nee

Re: [f2fs-dev] [PATCH] f2fs: improve block allocation statistics

2021-09-10 Thread Jaegeuk Kim
On 09/08, Fengnan Chang wrote: > From: Fengnan Chang > > improve block allocation statistics: > 1. fix missing inplace count in overwrite with direct io. > 2. separate buffer and direct io. Could you please split out two problems in separate patches? > > Signed-off-by: Fengnan Chang > --- >

Re: [f2fs-dev] [PATCH v4] f2fs: introduce fragment allocation mode mount option

2021-09-10 Thread Jaegeuk Kim
On 09/02, Daeho Jeong wrote: > From: Daeho Jeong > > Added three options into "mode=" mount option to make it possible for > developers to make the filesystem fragmented or simulate filesystem > fragmentation/after-GC situation itself. The developers use these modes > to understand filesystem

Re: [f2fs-dev] mkfs.f2fs -f to reformat Btrfs partition doesn't change FS type

2021-09-10 Thread Jaegeuk Kim
On 09/07, S. wrote: > Hi there, I develop Linux spins based on openSUSE Tumbleweed. Currently the > base system has Linux 5.14.0 and f2fs-tools 1.14.0. There is a bug that I can > consistently reproduce with: > # mkfs.f2fs -f /dev/sda1 > When the prior filesystem of /dev/sda1 is Btrfs, the

[f2fs-dev] [PATCH] mkfs.f2fs: wipe other FS magics given -f

2021-09-10 Thread Jaegeuk Kim
....| * 00010080 Signed-off-by: Jaegeuk Kim --- fsck/main.c | 2 +- include/f2fs_fs.h | 1 + lib/libf2fs.c | 6 ++ mkfs/f2fs_format_main.c | 26 ++ 4 files changed, 30 insertions(+), 5 deletions(-) diff --git a/fsck/main.c

Re: [f2fs-dev] [PATCH v2] f2fs: avoid attaching SB_ACTIVE flag during mount

2021-09-10 Thread Jaegeuk Kim
On 09/04, Chao Yu wrote: > On 2021/9/4 8:17, Jaegeuk Kim wrote: > > I remember this gave a regression before? > > I have removed changes which bothers checkpoint disabling path, how > about testing this in dev-test branch for a while? Let me give it a try. > >

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

2021-09-10 Thread Jaegeuk Kim
On 09/01, Chao Yu wrote: > This patch enables f2fs_balance_fs_bg() to check all metadatas' dirty > threshold rather than just checking node block's, so that checkpoint() > from background can be triggered more frequently to avoid heaping up > too much dirty metadatas. > > Threshold value by

Re: [f2fs-dev] [PATCH] f2fs: guarantee to write dirty data when enabling checkpoint back

2021-09-08 Thread Jaegeuk Kim
On 09/09, Greg KH wrote: > On Wed, Sep 08, 2021 at 10:28:37PM -0700, Jaegeuk Kim wrote: > > On 09/09, Greg KH wrote: > > > On Wed, Sep 08, 2021 at 03:00:20PM -0700, Jaegeuk Kim wrote: > > > > From: Jaegeuk Kim > > > > > > > > co

Re: [f2fs-dev] [PATCH] f2fs: guarantee to write dirty data when enabling checkpoint back

2021-09-08 Thread Jaegeuk Kim
On 09/09, Greg KH wrote: > On Wed, Sep 08, 2021 at 03:00:20PM -0700, Jaegeuk Kim wrote: > > From: Jaegeuk Kim > > > > commit 3d65293a52c2c3850c19b1e5115712e534d8 upstream. > > > > We must flush all the dirty data when enabling checkpoint back. Let's >

[f2fs-dev] [PATCH] f2fs: guarantee to write dirty data when enabling checkpoint back

2021-09-08 Thread Jaegeuk Kim via Linux-f2fs-devel
From: Jaegeuk Kim commit 3d65293a52c2c3850c19b1e5115712e534d8 upstream. We must flush all the dirty data when enabling checkpoint back. Let's guarantee that first by adding a retry logic on sync_inodes_sb(). In addition to that, this patch adds to flush data in fsync when checkpoint

[f2fs-dev] [PATCH] f2fs: should use GFP_NOFS for directory inodes

2021-09-07 Thread Jaegeuk Kim
6+0xc4/0x1e8 kswapd0:do_el0_svc+0x28/0xa0 kswapd0:el0_svc+0x24/0x38 kswapd0:el0_sync_handler+0x88/0xec kswapd0:el0_sync+0x1c0/0x200 Fixes: bdbc90fa55af ("f2fs: don't put dentry page in pagecache into highmem") Signed-off-by: Jaegeuk Kim --- fs/f2fs/inode.c |

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

2021-09-03 Thread Jaegeuk Kim
f2fs: compress: avoid duplicate counting of valid blocks when read compressed file f2fs: compress: allow write compress released file after truncate to zero f2fs: Don't create discard thread when device doesn't support realtime discard Jaegeuk Kim (7): f2fs: let's keep

Re: [f2fs-dev] [PATCH v2] f2fs: avoid attaching SB_ACTIVE flag during mount

2021-09-03 Thread Jaegeuk Kim
I remember this gave a regression before? On 09/01, Chao Yu wrote: > Quoted from [1] > > "I do remember that I've added this code back then because otherwise > orphan cleanup was losing updates to quota files. But you're right > that now I don't see how that could be happening and it would be

[f2fs-dev] [PATCH 2/2] f2fs: should put a page beyond EOF when preparing a write

2021-08-30 Thread Jaegeuk Kim
ing that page. Signed-off-by: Jaegeuk Kim --- fs/f2fs/data.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 8e8824605f83..41d29382eced 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -2183,6 +2183,8 @@ int f2fs_read_multi_pages(struct compress_ctx

[f2fs-dev] [PATCH 1/2] f2fs: deallocate compressed pages when error happens

2021-08-30 Thread Jaegeuk Kim
ges by f2fs_compress_free_page(). Let's fix memory leak by putting that just before deallocating cc->cpages. Signed-off-by: Jaegeuk Kim --- fs/f2fs/compress.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c index ec70a0a32327..c1bf9ad4c220

Re: [f2fs-dev] [PATCH v3] f2fs: don't ignore writing pages on fsync during checkpoint=disable

2021-08-26 Thread Jaegeuk Kim
>From 64fe93a7f9c35c2b5a34cfa3cf84158852c201be Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim Date: Thu, 19 Aug 2021 14:00:57 -0700 Subject: [PATCH] f2fs: guarantee to write dirty data when enabling checkpoint back We must flush all the dirty data when enabling checkpoint back. Let's guaran

Re: [f2fs-dev] [PATCH v2] f2fs: don't ignore writing pages on fsync during checkpoint=disable

2021-08-25 Thread Jaegeuk Kim
We must flush all the dirty data when enabling checkpoint back. Let's guarantee that first. In order to mitigate any failure, let's flush data in fsync as well during checkpoint=disable. Signed-off-by: Jaegeuk Kim --- v2 from v1: - handle sync_inodes_sb() failure fs/f2fs/file.c | 5

Re: [f2fs-dev] [PATCH] f2fs: don't ignore writing pages on fsync during checkpoint=disable

2021-08-25 Thread Jaegeuk Kim
On 08/25, Chao Yu wrote: > On 2021/8/25 1:09, Jaegeuk Kim wrote: > > On 08/24, Chao Yu wrote: > > > On 2021/8/24 1:01, Jaegeuk Kim wrote: > > > > We must flush dirty pages when calling fsync() during > > > > checkpoint=disable. > > > > Return

Re: [f2fs-dev] [PATCH] f2fs: fix wrong option name printed by parse_options()

2021-08-24 Thread Jaegeuk Kim
On 08/24, Chao Yu wrote: > It prints below kernel message during mounting w/ checkpoint=disable > option: > > "F2FS-fs (pmem0): checkpoint=merge cannot be used with checkpoint=disable" > > Fix typo "checkpoint=merge" w/ "checkpoint_merge" > > Signed-off-by: Chao Yu > --- > fs/f2fs/super.c | 6

Re: [f2fs-dev] [PATCH] f2fs: don't ignore writing pages on fsync during checkpoint=disable

2021-08-24 Thread Jaegeuk Kim
On 08/24, Chao Yu wrote: > On 2021/8/24 1:01, Jaegeuk Kim wrote: > > We must flush dirty pages when calling fsync() during checkpoint=disable. > > Returning zero makes inode being clear, which fails to flush them when > > enabling checkpoint back even by sync_inodes_sb(). &g

[f2fs-dev] [PATCH] f2fs_io: add rename w/ fsync option

2021-08-23 Thread Jaegeuk Kim
From: Jaegeuk Kim e.g., f2fs_io rename source dest 1 1. open(source) 2. rename(source, dest) 3. fsync(source) 4. close(source) Signed-off-by: Jaegeuk Kim --- tools/f2fs_io/f2fs_io.c | 36 1 file changed, 36 insertions(+) diff --git

Re: [f2fs-dev] [PATCH v4 1/2] f2fs: separate out iostat feature

2021-08-23 Thread Jaegeuk Kim
On 08/19, Daeho Jeong wrote: > From: Daeho Jeong > > Added F2FS_IOSTAT config option to support getting IO statistics through > sysfs and printing out periodic IO statistics tracepoint events and > moved I/O statistics related codes into separate files for better > maintenance. > >

[f2fs-dev] [PATCH] f2fs: don't ignore writing pages on fsync during checkpoint=disable

2021-08-23 Thread Jaegeuk Kim
We must flush dirty pages when calling fsync() during checkpoint=disable. Returning zero makes inode being clear, which fails to flush them when enabling checkpoint back even by sync_inodes_sb(). Signed-off-by: Jaegeuk Kim --- fs/f2fs/file.c | 5 ++--- 1 file changed, 2 insertions(+), 3

Re: [f2fs-dev] [PATCH] f2fs: remove broken support for allocating DIO writes

2021-08-17 Thread Jaegeuk Kim
On 08/17, Eric Biggers wrote: > On Tue, Aug 17, 2021 at 11:57:46AM -0700, Jaegeuk Kim wrote: > > On 08/17, Christoph Hellwig wrote: > > > On Mon, Aug 16, 2021 at 07:03:21PM -0700, Eric Biggers wrote: > > > > Freeing preallocated blocks on error would be better than n

Re: [f2fs-dev] [PATCH] f2fs: Add missing inline to f2fs_sanity_check_cluster() stub

2021-08-17 Thread Jaegeuk Kim
On 08/16, Nathan Chancellor wrote: > On 8/16/2021 5:33 PM, Jaegeuk Kim wrote: > > Hi Nathan, > > > > On 08/16, Nathan Chancellor wrote: > > > Without this, there is a warning in nearly every fs/f2fs/ file when > > > F2FS_FS_COMPRESSION is not set: >

<    4   5   6   7   8   9   10   11   12   13   >