Re: [f2fs-dev] [PATCH v6 2/7] fs: add infrastructure for multigrain timestamps

2023-08-02 Thread Jeff Layton
On Wed, 2023-08-02 at 21:35 +0200, Jan Kara wrote: > On Tue 25-07-23 10:58:15, Jeff Layton wrote: > > The VFS always uses coarse-grained timestamps when updating the ctime > > and mtime after a change. This has the benefit of allowing filesystems > > to optimize away a lot metadata updates, down to

Re: [f2fs-dev] [PATCH v6 4/7] tmpfs: add support for multigrain timestamps

2023-08-02 Thread Jan Kara
On Tue 25-07-23 10:58:17, Jeff Layton wrote: > Enable multigrain timestamps, which should ensure that there is an > apparent change to the timestamp whenever it has been written after > being actively observed via getattr. > > tmpfs only requires the FS_MGTIME flag. > > Signed-off-by: Jeff Layton

Re: [f2fs-dev] [PATCH v6 6/7] ext4: switch to multigrain timestamps

2023-08-02 Thread Jan Kara
On Tue 25-07-23 10:58:19, Jeff Layton wrote: > Enable multigrain timestamps, which should ensure that there is an > apparent change to the timestamp whenever it has been written after > being actively observed via getattr. > > For ext4, we only need to enable the FS_MGTIME flag. > > Signed-off-by

Re: [f2fs-dev] [PATCH v6 2/7] fs: add infrastructure for multigrain timestamps

2023-08-02 Thread Jan Kara
On Tue 25-07-23 10:58:15, Jeff Layton wrote: > The VFS always uses coarse-grained timestamps when updating the ctime > and mtime after a change. This has the benefit of allowing filesystems > to optimize away a lot metadata updates, down to around 1 per jiffy, > even when a file is under heavy writ

Re: [f2fs-dev] [PATCH v6 1/7] fs: pass the request_mask to generic_fillattr

2023-08-02 Thread Paulo Alcantara via Linux-f2fs-devel
Jeff Layton writes: > generic_fillattr just fills in the entire stat struct indiscriminately > today, copying data from the inode. There is at least one attribute > (STATX_CHANGE_COOKIE) that can have side effects when it is reported, > and we're looking at adding more with the addition of multig

Re: [f2fs-dev] [PATCH v6 5/7] xfs: switch to multigrain timestamps

2023-08-02 Thread Jeff Layton
On Wed, 2023-08-02 at 10:48 -0700, Darrick J. Wong wrote: > On Tue, Jul 25, 2023 at 10:58:18AM -0400, Jeff Layton wrote: > > Enable multigrain timestamps, which should ensure that there is an > > apparent change to the timestamp whenever it has been written after > > being actively observed via get

Re: [f2fs-dev] [PATCH v6 5/7] xfs: switch to multigrain timestamps

2023-08-02 Thread Darrick J. Wong
On Tue, Jul 25, 2023 at 10:58:18AM -0400, Jeff Layton wrote: > Enable multigrain timestamps, which should ensure that there is an > apparent change to the timestamp whenever it has been written after > being actively observed via getattr. > > Also, anytime the mtime changes, the ctime must also ch

Re: [f2fs-dev] [PATCH v6 1/7] fs: pass the request_mask to generic_fillattr

2023-08-02 Thread Jan Kara
On Tue 25-07-23 10:58:14, Jeff Layton wrote: > generic_fillattr just fills in the entire stat struct indiscriminately > today, copying data from the inode. There is at least one attribute > (STATX_CHANGE_COOKIE) that can have side effects when it is reported, > and we're looking at adding more with

Re: [f2fs-dev] [PATCH 12/12] xfs use fs_holder_ops for the log and RT devices

2023-08-02 Thread Darrick J. Wong
On Wed, Aug 02, 2023 at 05:41:31PM +0200, Christoph Hellwig wrote: > Use the generic fs_holder_ops to shut down the file system when the > log or RT device goes away instead of duplicating the logic. > > Signed-off-by: Christoph Hellwig Nice cleanup, Reviewed-by: Darrick J. Wong --D > --- >

Re: [f2fs-dev] [PATCH 11/12] xfs: drop s_umount over opening the log and RT devices

2023-08-02 Thread Darrick J. Wong
On Wed, Aug 02, 2023 at 05:41:30PM +0200, Christoph Hellwig wrote: > Just like get_tree_bdev needs to drop s_umount when opening the main > device, we need to do the same for the xfs log and RT devices to avoid a > potential lock order reversal with s_unmount for the mark_dead path. > > It might b

[f2fs-dev] [PATCH 12/12] xfs use fs_holder_ops for the log and RT devices

2023-08-02 Thread Christoph Hellwig
Use the generic fs_holder_ops to shut down the file system when the log or RT device goes away instead of duplicating the logic. Signed-off-by: Christoph Hellwig --- fs/xfs/xfs_super.c | 17 +++-- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/fs/xfs/xfs_super.c b/fs/

[f2fs-dev] [PATCH 10/12] ext4: use fs_holder_ops for the log device

2023-08-02 Thread Christoph Hellwig
Use the generic fs_holder_ops to shut down the file system when the log device goes away instead of duplicating the logic. Signed-off-by: Christoph Hellwig --- fs/ext4/super.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index

[f2fs-dev] [PATCH 04/12] btrfs: open block devices after superblock creation

2023-08-02 Thread Christoph Hellwig
Currently btrfs_mount_root opens the block devices before committing to allocating a super block. That creates problems for restricting the number of writers to a device, and also leads to a unusual and not very helpful holder (the fs_type). Reorganize the code to first look whether the superblock

[f2fs-dev] [PATCH 07/12] fs: stop using get_super in fs_mark_dead

2023-08-02 Thread Christoph Hellwig
fs_mark_dead currently uses get_super to find the superblock for the block device that is going away. This means it is limited to the main device stored in sb->s_dev, leading to a lot of code duplication for file systems that can use multiple block devices. Now that the holder for all block devic

[f2fs-dev] [PATCH 11/12] xfs: drop s_umount over opening the log and RT devices

2023-08-02 Thread Christoph Hellwig
Just like get_tree_bdev needs to drop s_umount when opening the main device, we need to do the same for the xfs log and RT devices to avoid a potential lock order reversal with s_unmount for the mark_dead path. It might be preferable to just drop s_umount over ->fill_super entirely, but that will

[f2fs-dev] more blkdev_get and holder work

2023-08-02 Thread Christoph Hellwig
Hi all, this series sits on top of the vfs.super branch in the VFS tree and does a few closely related things: 1) it also converts nilfs2 and btrfs to the new scheme where the file system only opens the block devices after we know that a new super_block was allocated. 2) it then mak

[f2fs-dev] [PATCH 08/12] fs: export fs_holder_ops

2023-08-02 Thread Christoph Hellwig
Export fs_holder_ops so that file systems that open additional block devices can use it as well. Signed-off-by: Christoph Hellwig --- fs/super.c | 3 ++- include/linux/blkdev.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/super.c b/fs/super.c index 0cda4af

[f2fs-dev] [PATCH 01/12] fs: export setup_bdev_super

2023-08-02 Thread Christoph Hellwig
We'll want to use setup_bdev_super instead of duplicating it in nilfs2. Signed-off-by: Christoph Hellwig --- fs/super.c | 3 ++- include/linux/fs_context.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/super.c b/fs/super.c index 3ef39df5bec506..6aaa275f

[f2fs-dev] [PATCH 09/12] ext4: drop s_umount over opening the log device

2023-08-02 Thread Christoph Hellwig
Just like get_tree_bdev needs to drop s_umount when opening the main device, we need to do the same for the ext4 log device to avoid a potential lock order reversal with s_unmount for the mark_dead path. It might be preferable to just drop s_umount over ->fill_super entirely, but that will require

[f2fs-dev] [PATCH 06/12] fs: use the super_block as holder when mounting file systems

2023-08-02 Thread Christoph Hellwig
The file system type is not a very useful holder as it doesn't allow us to go back to the actual file system instance. Pass the super_block instead which is useful when passed back to the file system driver. Signed-off-by: Christoph Hellwig --- fs/btrfs/super.c | 7 ++- fs/f2fs/super.c | 7

[f2fs-dev] [PATCH 02/12] nilfs2: use setup_bdev_super to de-duplicate the mount code

2023-08-02 Thread Christoph Hellwig
Use the generic setup_bdev_super helper to open the main block device and do various bits of superblock setup instead of duplicating the logic. This includes moving to the new scheme implemented in common code that only opens the block device after the superblock has allocated. It does not yet co

[f2fs-dev] [PATCH 03/12] btrfs: always open the device read-only in btrfs_scan_one_device

2023-08-02 Thread Christoph Hellwig
btrfs_scan_one_device opens the block device only to read the super block. Instead of passing a blk_mode_t argument to sometimes open it for writing, just hard code BLK_OPEN_READ as it will never write to the device or hand the block_device out to someone else. Signed-off-by: Christoph Hellwig -

[f2fs-dev] [PATCH 05/12] ext4: make the IS_EXT2_SB/IS_EXT3_SB checks more robust

2023-08-02 Thread Christoph Hellwig
Check for sb->s_type which is the right place to look at the file system type, not the holder, which is just an implementation detail in the VFS helpers. Signed-off-by: Christoph Hellwig --- fs/ext4/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ext4/super.c b

Re: [f2fs-dev] [PATCH] f2fs: Only lfs mode is allowed with zoned block device feature

2023-08-02 Thread Chao Yu
On 2023/6/20 22:10, Chunhai Guo wrote: Now f2fs support four block allocation modes: lfs, adaptive, fragment:segment, fragment:block. Only lfs mode is allowed with zoned block device feature. Signed-off-by: Chunhai Guo --- fs/f2fs/super.c | 12 +++- 1 file changed, 7 insertions(+), 5

Re: [f2fs-dev] [PATCH v2] f2fs: introduce two helper functions for the largest cached extent

2023-08-02 Thread Chao Yu
On 2023/7/26 14:16, Chao Liu wrote: On 7月 26 09:24, Chao Yu wrote: On 2023/7/25 9:36, Chao Liu wrote: From: Chao Liu This patch is a cleanup: 1. Merge __drop_largest_extent() since it has only one caller. 2. Introduce __unlock_tree_with_checking_largest() and __drop_largest_extent() to h

Re: [f2fs-dev] [syzbot] [f2fs?] general protection fault in f2fs_drop_extent_tree

2023-08-02 Thread Aleksandr Nogikh via Linux-f2fs-devel
On Wed, Aug 2, 2023 at 2:41 AM syzbot wrote: > > syzbot suspects this issue was fixed by commit: > > commit 458c15dfbce62c35fefd9ca637b20a051309c9f1 > Author: Chao Yu > Date: Tue May 23 03:58:22 2023 + > > f2fs: don't reset unchangable mount option in f2fs_remount() > > bisection log:

Re: [f2fs-dev] [PATCH] f2fs: Only lfs mode is allowed with zoned block device feature

2023-08-02 Thread Chunhai Guo via Linux-f2fs-devel
Hi Chao & Jaegeuk, Could you please help to review this patch? Thanks. On 2023/6/20 22:10, 郭纯海 wrote: Now f2fs support four block allocation modes: lfs, adaptive, fragment:segment, fragment:block. Only lfs mode is allowed with zoned block device feature. Signed-off-by: Chunhai Guo --- fs/f