[f2fs-dev] [PATCH] f2fs: including waf data in f2fs status information

2023-06-01 Thread beomsu kim
When evaluating in f2fs, it takes much time to obtain waf data. This patch helps to obtain waf data without calcluation. Signed-off-by: Beomsu Kim --- fs/f2fs/iostat.c | 16 1 file changed, 16 insertions(+) diff --git a/fs/f2fs/iostat.c b/fs/f2fs/iostat.c index 3d5bfb1ad585..6e

Re: [f2fs-dev] [PATCH v2 4/6] fs: Establish locking order for unrelated directories

2023-06-01 Thread kernel test robot
Hi Jan, kernel test robot noticed the following build errors: [auto build test ERROR on tytso-ext4/dev] [also build test ERROR on jaegeuk-f2fs/dev-test jaegeuk-f2fs/dev linus/master v6.4-rc4 next-20230601] [cannot apply to vfs-idmapping/for-next] [If your patch is applied to the wrong git tree

Re: [f2fs-dev] [PATCH v2 4/6] fs: Establish locking order for unrelated directories

2023-06-01 Thread David Laight
From: Jan Kara > Sent: 01 June 2023 17:14 > > On Thu 01-06-23 15:37:32, David Laight wrote: > > ... > > > > > + * Lock any non-NULL argument. The caller must make sure that if he > > > > > is passing > > > > > + * in two directories, one is not ancestor of the other > > > > Not directly relevant

Re: [f2fs-dev] [PATCH v2 4/6] fs: Establish locking order for unrelated directories

2023-06-01 Thread Christian Brauner
On Thu, Jun 01, 2023 at 06:13:53PM +0200, Jan Kara wrote: > On Thu 01-06-23 15:37:32, David Laight wrote: > > ... > > > > > + * Lock any non-NULL argument. The caller must make sure that if he > > > > > is passing > > > > > + * in two directories, one is not ancestor of the other > > > > Not dire

Re: [f2fs-dev] [PATCH v2 4/6] fs: Establish locking order for unrelated directories

2023-06-01 Thread Jan Kara
On Thu 01-06-23 15:37:32, David Laight wrote: > ... > > > > + * Lock any non-NULL argument. The caller must make sure that if he is > > > > passing > > > > + * in two directories, one is not ancestor of the other > > Not directly relevant to this change but is the 'not an ancestor' > check actual

Re: [f2fs-dev] [PATCH v2 4/6] fs: Establish locking order for unrelated directories

2023-06-01 Thread Christian Brauner
On Thu, Jun 01, 2023 at 05:24:49PM +0200, Jan Kara wrote: > On Thu 01-06-23 15:58:58, Christian Brauner wrote: > > On Thu, Jun 01, 2023 at 12:58:24PM +0200, Jan Kara wrote: > > > Currently the locking order of inode locks for directories that are not > > > in ancestor relationship is not defined be

Re: [f2fs-dev] [PATCH v2 1/6] ext4: Remove ext4 locking of moved directory

2023-06-01 Thread Christian Brauner
On Thu, Jun 01, 2023 at 05:27:46PM +0200, Jan Kara wrote: > On Thu 01-06-23 10:52:22, Theodore Ts'o wrote: > > On Thu, Jun 01, 2023 at 12:58:21PM +0200, Jan Kara wrote: > > > Remove locking of moved directory in ext4_rename2(). We will take care > > > of it in VFS instead. This effectively reverts

Re: [f2fs-dev] [PATCH v2 4/6] fs: Establish locking order for unrelated directories

2023-06-01 Thread David Laight
... > > > + * Lock any non-NULL argument. The caller must make sure that if he is > > > passing > > > + * in two directories, one is not ancestor of the other Not directly relevant to this change but is the 'not an ancestor' check actually robust? I found a condition in which the kernel 'pwd' co

Re: [f2fs-dev] [PATCH v2 1/6] ext4: Remove ext4 locking of moved directory

2023-06-01 Thread Jan Kara
On Thu 01-06-23 10:52:22, Theodore Ts'o wrote: > On Thu, Jun 01, 2023 at 12:58:21PM +0200, Jan Kara wrote: > > Remove locking of moved directory in ext4_rename2(). We will take care > > of it in VFS instead. This effectively reverts commit 0813299c586b > > ("ext4: Fix possible corruption when movin

Re: [f2fs-dev] [PATCH v2 4/6] fs: Establish locking order for unrelated directories

2023-06-01 Thread Jan Kara
On Thu 01-06-23 15:58:58, Christian Brauner wrote: > On Thu, Jun 01, 2023 at 12:58:24PM +0200, Jan Kara wrote: > > Currently the locking order of inode locks for directories that are not > > in ancestor relationship is not defined because all operations that > > needed to lock two directories like

[f2fs-dev] [PATCH 11/12] fuse: drop redundant arguments to fuse_perform_write

2023-06-01 Thread Christoph Hellwig
pos is always equal to iocb->ki_pos, and mapping is always equal to iocb->ki_filp->f_mapping. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Acked-by: Miklos Szeredi --- fs/fuse/file.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-)

[f2fs-dev] [PATCH 08/12] iomap: use kiocb_write_and_wait and kiocb_invalidate_pages

2023-06-01 Thread Christoph Hellwig
Use the common helpers for direct I/O page invalidation instead of open coding the logic. This leads to a slight reordering of checks in __iomap_dio_rw to keep the logic straight. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: Darrick J.

[f2fs-dev] [PATCH 12/12] fuse: use direct_write_fallback

2023-06-01 Thread Christoph Hellwig
Use the generic direct_write_fallback helper instead of duplicating the logic. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal --- fs/fuse/file.c | 24 ++-- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index b4e2

[f2fs-dev] [PATCH 10/12] fuse: update ki_pos in fuse_perform_write

2023-06-01 Thread Christoph Hellwig
Both callers of fuse_perform_write need to updated ki_pos, move it into common code. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal --- fs/fuse/file.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 9

[f2fs-dev] [PATCH 09/12] fs: factor out a direct_write_fallback helper

2023-06-01 Thread Christoph Hellwig
Add a helper dealing with handling the syncing of a buffered write fallback for direct I/O. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Miklos Szeredi --- fs/libfs.c | 41 include/linux/fs.h | 2 ++ mm/filemap.c | 66 +++

[f2fs-dev] [PATCH 06/12] filemap: add a kiocb_invalidate_post_direct_write helper

2023-06-01 Thread Christoph Hellwig
Add a helper to invalidate page cache after a dio write. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Acked-by: Darrick J. Wong --- fs/direct-io.c | 10 ++ fs/iomap/direct-io.c| 12 ++-- include/linux/fs.h | 5 ---

[f2fs-dev] [PATCH 05/12] filemap: add a kiocb_invalidate_pages helper

2023-06-01 Thread Christoph Hellwig
Factor out a helper that calls filemap_write_and_wait_range and invalidate_inode_pages2_range for the range covered by a write kiocb or returns -EAGAIN if the kiocb is marked as nowait and there would be pages to write or invalidate. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal R

[f2fs-dev] [PATCH 04/12] filemap: add a kiocb_write_and_wait helper

2023-06-01 Thread Christoph Hellwig
Factor out a helper that does filemap_write_and_wait_range for the range covered by a read kiocb, or returns -EAGAIN if the kiocb is marked as nowait and there would be pages to write. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Acked-by: Darrick J.

[f2fs-dev] [PATCH 01/12] backing_dev: remove current->backing_dev_info

2023-06-01 Thread Christoph Hellwig
The last user of current->backing_dev_info disappeared in commit b9b1335e6403 ("remove bdi_congested() and wb_congested() and related functions"). Remove the field and all assignments to it. Signed-off-by: Christoph Hellwig Reviewed-by: Christian Brauner Reviewed-by: Damien Le Moal Reviewed-by

[f2fs-dev] [PATCH 07/12] iomap: update ki_pos in iomap_file_buffered_write

2023-06-01 Thread Christoph Hellwig
All callers of iomap_file_buffered_write need to updated ki_pos, move it into common code. Signed-off-by: Christoph Hellwig Reviewed-by: Andreas Gruenbacher Reviewed-by: Hannes Reinecke Reviewed-by: Darrick J. Wong Acked-by: Damien Le Moal --- fs/gfs2/file.c | 4 +--- fs/iomap/buffer

[f2fs-dev] [PATCH 02/12] iomap: update ki_pos a little later in iomap_dio_complete

2023-06-01 Thread Christoph Hellwig
Move the ki_pos update down a bit to prepare for a better common helper that invalidates pages based of an iocb. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: Darrick J. Wong --- fs/iomap/direct-io.c | 21 +++-- 1 file c

[f2fs-dev] [PATCH 03/12] filemap: update ki_pos in generic_perform_write

2023-06-01 Thread Christoph Hellwig
All callers of generic_perform_write need to updated ki_pos, move it into common code. Signed-off-by: Christoph Hellwig Reviewed-by: Xiubo Li Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Acked-by: Theodore Ts'o Acked-by: Darrick J. Wong --- fs/ceph/file.c | 2 -- fs/ext4/file.c

[f2fs-dev] cleanup the filemap / direct I/O interaction v4

2023-06-01 Thread Christoph Hellwig
Hi all, this series cleans up some of the generic write helper calling conventions and the page cache writeback / invalidation for direct I/O. This is a spinoff from the no-bufferhead kernel project, for which we'll want to an use iomap based buffered write path in the block layer. Changes since

Re: [f2fs-dev] [PATCH v2 1/6] ext4: Remove ext4 locking of moved directory

2023-06-01 Thread Theodore Ts'o
On Thu, Jun 01, 2023 at 12:58:21PM +0200, Jan Kara wrote: > Remove locking of moved directory in ext4_rename2(). We will take care > of it in VFS instead. This effectively reverts commit 0813299c586b > ("ext4: Fix possible corruption when moving a directory") and followup > fixes. Remind me --- co

Re: [f2fs-dev] [PATCH] f2fs: add f2fs_ioc_[get|set]_extra_attr

2023-06-01 Thread Sheng Yong via Linux-f2fs-devel
On 2023/6/1 11:16, Eric Biggers wrote: On Mon, May 29, 2023 at 09:35:00AM +0800, Sheng Yong via Linux-f2fs-devel wrote: This patch introduces two ioctls: * f2fs_ioc_get_extra_attr * f2fs_ioc_set_extra_attr to get or modify values in extra attribute area. The argument of these two ioctl

Re: [f2fs-dev] [PATCH] f2fs: including waf data in f2fs status information

2023-06-01 Thread kernel test robot
Hi beomsu, kernel test robot noticed the following build errors: [auto build test ERROR on v6.4-rc4] [also build test ERROR on linus/master next-20230601] [cannot apply to jaegeuk-f2fs/dev-test jaegeuk-f2fs/dev] [If your patch is applied to the wrong git tree, kindly drop us a note. And when

Re: [f2fs-dev] [PATCH v2 4/6] fs: Establish locking order for unrelated directories

2023-06-01 Thread Christian Brauner
On Thu, Jun 01, 2023 at 12:58:24PM +0200, Jan Kara wrote: > Currently the locking order of inode locks for directories that are not > in ancestor relationship is not defined because all operations that > needed to lock two directories like this were serialized by > sb->s_vfs_rename_mutex. However s

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

2023-06-01 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=216050 --- Comment #171 from Guido (guido.iod...@gmail.com) --- All ok here with kernel 6.4 since May, 5th. My mount options: /dev/nvme0n1p3 on / type f2fs (rw,noatime,lazytime,background_gc=on,gc_merge,nodiscard,no_heap,user_xattr,inline_xattr,acl,inl

[f2fs-dev] [PATCH v2 3/6] Revert "f2fs: fix potential corruption when moving a directory"

2023-06-01 Thread Jan Kara
This reverts commit d94772154e524b329a168678836745d2773a6e02. The locking is going to be provided by VFS. CC: Jaegeuk Kim CC: sta...@vger.kernel.org Signed-off-by: Jan Kara --- fs/f2fs/namei.c | 16 +--- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/fs/f2fs/namei.c b

[f2fs-dev] [PATCH v2 0/6] fs: Fix directory corruption when moving directories

2023-06-01 Thread Jan Kara
Hello, this patch set fixes a problem with cross directory renames originally reported in [1]. To quickly sum it up some filesystems (so far we know at least about ext4, udf, f2fs, ocfs2, likely also reiserfs, gfs2 and others) need to lock the directory when it is being renamed into another direct

[f2fs-dev] [PATCH v2 1/6] ext4: Remove ext4 locking of moved directory

2023-06-01 Thread Jan Kara
Remove locking of moved directory in ext4_rename2(). We will take care of it in VFS instead. This effectively reverts commit 0813299c586b ("ext4: Fix possible corruption when moving a directory") and followup fixes. CC: Ted Tso CC: sta...@vger.kernel.org Signed-off-by: Jan Kara --- fs/ext4/name

[f2fs-dev] [PATCH v2 6/6] fs: Restrict lock_two_nondirectories() to non-directory inodes

2023-06-01 Thread Jan Kara
Currently lock_two_nondirectories() is skipping any passed directories. After vfs_rename() uses lock_two_inodes(), all the remaining four users of this function pass only regular files to it. So drop the somewhat unusual "skip directory" logic and instead warn if anybody passes directory to it. Thi

[f2fs-dev] [PATCH v2 2/6] Revert "udf: Protect rename against modification of moved directory"

2023-06-01 Thread Jan Kara
This reverts commit f950fd0529130a617b3da526da9fb6a896ce87c2. The locking is going to be provided by vfs_rename() in the following patches. CC: sta...@vger.kernel.org Signed-off-by: Jan Kara --- fs/udf/namei.c | 14 ++ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/fs

[f2fs-dev] [PATCH v2 5/6] fs: Lock moved directories

2023-06-01 Thread Jan Kara
When a directory is moved to a different directory, some filesystems (udf, ext4, ocfs2, f2fs, and likely gfs2, reiserfs, and others) need to update their pointer to the parent and this must not race with other operations on the directory. Lock the directories when they are moved. Although not all f

[f2fs-dev] [PATCH v2 4/6] fs: Establish locking order for unrelated directories

2023-06-01 Thread Jan Kara
Currently the locking order of inode locks for directories that are not in ancestor relationship is not defined because all operations that needed to lock two directories like this were serialized by sb->s_vfs_rename_mutex. However some filesystems need to lock two subdirectories for RENAME_EXCHANG

[f2fs-dev] [PATCH] f2fs_io: support gc_range command

2023-06-01 Thread Chao Yu
This patch supports a new sub-command 'gc_range' in f2fs_io to trigger gc to move blocks in specified range via F2FS_IOC_GARBAGE_COLLECT_RANGE ioctl. Signed-off-by: Chao Yu --- man/f2fs_io.8 | 3 +++ tools/f2fs_io/f2fs_io.c | 35 +++ 2 files changed, 38