Re: [f2fs-dev] [PATCH 01/32] block: Provide blkdev_get_handle_* functions

2023-07-31 Thread Christoph Hellwig
On Mon, Jul 31, 2023 at 12:50:34PM +0200, Jan Kara wrote: > I think the bdev_handle name is fine for the struct. After all it is > equivalent of an open handle for the block device so IMHO bdev_handle > captures that better than bdev_ctx. Agreed. ___ L

[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/supe

[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 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/su

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

2023-08-02 Thread Christoph Hellwig
convert nilfs2 to the new mount API, but doing so will become a bit simpler after this first step. Signed-off-by: Christoph Hellwig --- fs/nilfs2/super.c | 81 ++- 1 file changed, 30 insertions(+), 51 deletions(-) diff --git a/fs/nilfs2/super.c b/fs

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

2023-08-02 Thread Christoph Hellwig
ill require a fairly massive audit first, so we'll do the easy version here first. Signed-off-by: Christoph Hellwig --- fs/ext4/super.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 193d665813b611..2ccb19d345c6dd 100644 --- a/fs/ext4/super.c +++ b

[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

[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 3ef39df5b

[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 11/12] xfs: drop s_umount over opening the log and RT devices

2023-08-02 Thread Christoph Hellwig
ill require a fairly massive audit first, so we'll do the easy version here first. Signed-off-by: Christoph Hellwig --- fs/xfs/xfs_super.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 8185102431301d..d50424

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

2023-08-02 Thread Christoph Hellwig
ock devices used by file systems is set to the super_block, we can instead look at that holder and then check if the file system is born and active, so do that instead. Signed-off-by: Christoph Hellwig --- fs/super.c | 30 ++ 1 file changed, 26 insertions(+), 4 deleti

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

2023-08-02 Thread Christoph Hellwig
superblock for a particular fsid does already exist and open the block devices only if it doesn't, mirror the recent changes to the VFS mount helpers. Signed-off-by: Christoph Hellwig --- fs/btrfs/super.c | 51 ++ fs/btrfs/volumes.c | 4 ++-- 2 files ch

[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 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

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

2023-08-05 Thread Christoph Hellwig
On Wed, Aug 02, 2023 at 09:32:19AM -0700, Darrick J. Wong wrote: > > + /* see get_tree_bdev why this is needed and safe */ > > Which part of get_tree_bdev? Is it this? > > /* >* s_umount nests inside open_mutex during >* __invalidate_device(). blk

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

2023-08-05 Thread Christoph Hellwig
On Thu, Aug 03, 2023 at 03:33:30PM +0200, Jan Kara wrote: > As a side note, after this patch we can also remove bdev->bd_super and > transition the two real users (mark_buffer_write_io_error() and two places > in ocfs2) to use bd_holder. Ext4 also uses bd_super but there it is really > pointless as

Re: [f2fs-dev] [PATCH v2 0/29] block: Make blkdev_get_by_*() return handle

2023-08-11 Thread Christoph Hellwig
Except for a mostly cosmetic nitpick this looks good to me: Acked-by: Christoph Hellwig That's not eactly the deep review I'd like to do, but as I'm about to head out for vacation that's probably as good as it gets. ___ Linux-f2f

Re: [f2fs-dev] [PATCH 01/30] block: also call ->open for incremental partition opens

2023-08-28 Thread Christoph Hellwig
On Fri, Aug 25, 2023 at 03:44:57AM +0100, Al Viro wrote: > That got me curious about the ->bd_openers - do we need it atomic? > Most of the users (and all places that do modifications) are > under ->open_mutex; the only exceptions are > * early sync logics in blkdev_put(); it's explicitly rac

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

2023-08-28 Thread Christoph Hellwig
On Sun, Aug 27, 2023 at 08:41:22PM +0100, Al Viro wrote: > That part is somewhat fishy - there's a case where you return a positive value > and advance ->ki_pos by more than that amount. I really wonder if all callers > of ->write_iter() are OK with that. Consider e.g. this: This should not exis

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

2023-08-28 Thread Christoph Hellwig
On Sun, Aug 27, 2023 at 10:45:18PM +0100, Al Viro wrote: > IOW, I suspect that the right thing to do would be something along the lines > of The idea looks sensible to me, but we'll also need to do it for the filemap_write_and_wait_range failure case. ___

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

2023-08-28 Thread Christoph Hellwig
-= buffered_written. > > Or am I completely misparsing what you've written? No, I misread the patch. Looks good: Acked-by: Christoph Hellwig ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Re: [f2fs-dev] [PATCH v2 0/29] block: Make blkdev_get_by_*() return handle

2023-08-28 Thread Christoph Hellwig
On Fri, Aug 25, 2023 at 03:47:56PM +0200, Jan Kara wrote: > I can see the appeal of not having to introduce the new bdev_handle type > and just using struct file which unifies in-kernel and userspace block > device opens. But I can see downsides too - the last fput() happening from > task work make

Re: [f2fs-dev] [PATCH v2 0/29] block: Make blkdev_get_by_*() return handle

2023-08-28 Thread Christoph Hellwig
On Sat, Aug 26, 2023 at 03:28:52AM +0100, Al Viro wrote: > I mean, look at claim_swapfile() for example: > p->bdev = blkdev_get_by_dev(inode->i_rdev, >FMODE_READ | FMODE_WRITE | FMODE_EXCL, p); > if (IS_ERR(p->bdev)) { >

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

2023-09-13 Thread Christoph Hellwig
> direct_write_fallback(): on error revert the ->ki_pos update from buffered > write Al, Christian: can you send this fix on top Linus? ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listi

Re: [f2fs-dev] [PATCH 1/3] btrfs: call btrfs_close_devices from ->kill_sb

2023-12-13 Thread Christoph Hellwig
On Tue, Dec 12, 2023 at 08:00:16PM -0800, Eric Biggers wrote: > From: Christoph Hellwig > > blkdev_put must not be called under sb->s_umount to avoid a lock order > reversal with disk->open_mutex once call backs from block devices to > the file system using the holder ops

Re: [f2fs-dev] [PATCH 3/3] fs: move fscrypt keyring destruction to after ->put_super

2023-12-13 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Re: [f2fs-dev] [PATCH 1/3] btrfs: call btrfs_close_devices from ->kill_sb

2023-12-15 Thread Christoph Hellwig
On Fri, Dec 15, 2023 at 04:45:50PM -0500, Josef Bacik wrote: > I ran it through, you broke a test that isn't upstream yet to test the old > mount > api double mount thing that I have a test for > > https://github.com/btrfs/fstests/commit/2796723e77adb0f9da1059acf13fc402467f7ac4 > > In this case

[f2fs-dev] [PATCH 4/5] block: simplify disk_set_zoned

2023-12-17 Thread Christoph Hellwig
Only use disk_set_zoned to actually enable zoned device support. For clearing it, call disk_clear_zoned, which is renamed from disk_clear_zone_settings and now directly clears the zoned flag as well. Signed-off-by: Christoph Hellwig --- block/blk-settings.c | 32

[f2fs-dev] [PATCH 1/5] virtio_blk: cleanup zoned device probing

2023-12-17 Thread Christoph Hellwig
CONFIG_BLK_DEV_ZONED, and improve it for the !CONFIG_BLK_DEV_ZONED case. Signed-off-by: Christoph Hellwig --- drivers/block/virtio_blk.c | 50 +- 1 file changed, 22 insertions(+), 28 deletions(-) diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index

[f2fs-dev] [PATCH 5/5] sd: only call disk_clear_zoned when needed

2023-12-17 Thread Christoph Hellwig
ff-by: Christoph Hellwig --- drivers/scsi/sd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index dbed075cdb981a..8c8ac5cd1833b4 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -3149,7 +3149,7 @@ static void sd_read_block_characteri

[f2fs-dev] remove support for the host aware zoned model

2023-12-17 Thread Christoph Hellwig
Hi all, hen zones were first added the SCSI and ATA specs, two different models were supported (in addition to the drive managed one that is invisible to the host): - host managed where non-conventional zones there is strict requirement to write at the write pointer, or else an error is retur

[f2fs-dev] [PATCH 3/5] block: remove support for the host aware zone model

2023-12-17 Thread Christoph Hellwig
this model which never made it to mass production. Drop the support before it is too late. Note that any such host aware prototype HDD can still be used with Linux as we'll now treat it as a conventional HDD. Signed-off-by: Christoph Hellwig --- block/blk-settings.c

[f2fs-dev] [PATCH 2/5] virtio_blk: remove the broken zone revalidation support

2023-12-17 Thread Christoph Hellwig
ut it can be readded in a fixed version with proper test coverage if needed. Fixes: 95bfec41bd3d ("virtio-blk: add support for zoned block devices") Fixes: f1ba4e674feb ("virtio-blk: fix to match virtio spec") Signed-off-by: Christoph Hellwig --- drivers/block/virtio_blk.c |

Re: [f2fs-dev] [PATCH 3/5] block: remove support for the host aware zone model

2023-12-18 Thread Christoph Hellwig
On Mon, Dec 18, 2023 at 06:48:43PM +0900, Damien Le Moal wrote: > > - if (devip->zmodel == BLK_ZONED_HA) > > - arr[4] = 1 << 4;/* zoned field = 01b */ > > I think we should keep everything related to HA in scsi debug as that is an > easy > way to test the block layer and scsi.

Re: [f2fs-dev] [PATCH 0/3] Add {init, exit}_sequence_fs() helper function

2024-07-11 Thread Christoph Hellwig
Can we please stop this boilerplate code an instead our __init/__exit sections to supper multiple entires per module. This should be mostly trivial, except that we'd probably want a single macro that has the init and exit calls so that the order in the section is the same and the unroll on failure

Re: [f2fs-dev] [PATCH 0/3] Add {init, exit}_sequence_fs() helper function

2024-07-23 Thread Christoph Hellwig
On Tue, Jul 23, 2024 at 04:44:14PM +0800, Youling Tang wrote: > Thanks for your suggestion,  I re-implemented it using section mode, > and the new patch set [1] has been sent. Nice! I'll review it. ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@l

Re: [f2fs-dev] [PATCH 1/4] module: Add module_subinit{_noexit} and module_subeixt helper macros

2024-07-23 Thread Christoph Hellwig
On Tue, Jul 23, 2024 at 04:32:36PM +0800, Youling Tang wrote: > Providing module_subinit{_noexit} and module_subeixt helps macros ensure > that modules init/exit match their order, while also simplifying the code. > > The three macros are defined as follows: > - module_subinit(initfn, exitfn,rollb

Re: [f2fs-dev] [PATCH 1/4] module: Add module_subinit{_noexit} and module_subeixt helper macros

2024-07-24 Thread Christoph Hellwig
On Wed, Jul 24, 2024 at 09:57:05AM +0800, Youling Tang wrote: > module_init(initfn)/module_exit(exitfn) has two definitions (via MODULE): > - buindin: uses do_initcalls() to iterate over the contents of the specified >   section and executes all initfn functions in the section in the order in >   w

Re: [f2fs-dev] [PATCH 1/4] module: Add module_subinit{_noexit} and module_subeixt helper macros

2024-07-25 Thread Christoph Hellwig
On Thu, Jul 25, 2024 at 11:01:33AM +0800, Youling Tang wrote: > - It doesn't feel good to have only one subinit/exit in a file. >   Assuming that there is only one file in each file, how do we >   ensure that the files are linked in order?(Is it sorted by *.o >   in the Makefile?) Yes, link order

Re: [f2fs-dev] [PATCH 1/4] module: Add module_subinit{_noexit} and module_subeixt helper macros

2024-07-25 Thread Christoph Hellwig
On Thu, Jul 25, 2024 at 05:30:58PM +0200, Arnd Bergmann wrote: > Now I think we could just make the module_init() macro > do the same thing as a built-in initcall() and put > an entry in a special section, to let you have multiple > entry points in a loadable module. > > There are still at least t

Re: [f2fs-dev] [PATCH 1/4] module: Add module_subinit{_noexit} and module_subeixt helper macros

2024-07-25 Thread Christoph Hellwig
On Thu, Jul 25, 2024 at 07:14:14PM +0200, Goffredo Baroncelli wrote: > Instead of relying to the "expected" order of the compiler/linker, > why doesn't manage the chain explicitly ? Something like: Because that doesn't actually solve anything over simple direct calls as you still need the symbols

Re: [f2fs-dev] [PATCH 1/4] module: Add module_subinit{_noexit} and module_subeixt helper macros

2024-07-26 Thread Christoph Hellwig
On Fri, Jul 26, 2024 at 04:54:59PM +0800, Youling Tang wrote: > Based on this patch, we may need to do these things with this > > > 1. Change the order of *.o in the Makefile (the same order as before the > change) While we'll need to be careful, we don't need to match the exact order. Most of th

Re: [f2fs-dev] [PATCH 1/4] module: Add module_subinit{_noexit} and module_subeixt helper macros

2024-07-26 Thread Christoph Hellwig
On Fri, Jul 26, 2024 at 01:58:00PM -0400, Theodore Ts'o wrote: > Yeah, that's my reaction as well. This only saves 50 lines of code in > ext4, and that includes unrelated changes such as getting rid of "int > i" and putting the declaration into the for loop --- "for (int i = > ..."). Sure, that s

Re: [f2fs-dev] [PATCH 1/4] module: Add module_subinit{_noexit} and module_subeixt helper macros

2024-07-29 Thread Christoph Hellwig
On Sun, Jul 28, 2024 at 10:44:12PM -0400, Theodore Ts'o wrote: > > > > Personally, I prefer the implementation of method two. > > But there's also method zero --- keep things the way they are, and > don't try to add a new astraction. > > Advantage: > > -- Code has worked for decades, so it is v

Re: [f2fs-dev] [PATCH v2] f2fs: check discard support for conventional zones

2024-08-15 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Re: [f2fs-dev] [PATCH v5 1/5] fs, block: refactor enum rw_hint

2024-09-12 Thread Christoph Hellwig
On Tue, Sep 10, 2024 at 08:31:56PM +0530, Kanchan Joshi wrote: > Rename enum rw_hint to rw_lifetime_hint. > Change i_write_hint (in inode), bi_write_hint(in bio), and write_hint > (in request) to use u8 data-type rather than this enum. > > This is in preparation to introduce a new write hint type.

Re: [f2fs-dev] [PATCH v5 3/5] fcntl: add F_{SET/GET}_RW_HINT_EX

2024-09-12 Thread Christoph Hellwig
On Tue, Sep 10, 2024 at 08:31:58PM +0530, Kanchan Joshi wrote: > This is similar to existing F_{SET/GET}_RW_HINT but more > generic/extensible. > > F_SET/GET_RW_HINT_EX take a pointer to a struct rw_hint_ex as argument: > > struct rw_hint_ex { > __u8type; > __u8pad[7]; >

Re: [f2fs-dev] [PATCH v5 4/5] sd: limit to use write life hints

2024-09-12 Thread Christoph Hellwig
On Tue, Sep 10, 2024 at 08:31:59PM +0530, Kanchan Joshi wrote: > From: Nitesh Shetty > > The incoming hint value maybe either lifetime hint or placement hint. .. may either be .. ? > Make SCSI interpret only temperature-based write lifetime hints. > > Signed-off-by: Nitesh Shetty > Signed-off

Re: [f2fs-dev] [PATCH v5 2/5] fcntl: rename rw_hint_* to rw_lifetime_hint_*

2024-09-12 Thread Christoph Hellwig
On Tue, Sep 10, 2024 at 08:31:57PM +0530, Kanchan Joshi wrote: > F_GET/SET_RW_HINT fcntl handlers query/set write life hints. > Rename the handlers/helpers to be explicit that write life hints are > being handled. > > This is in preparation to introduce a new interface that supports more > than on

Re: [f2fs-dev] [PATCH] f2fs: fix to don't set SB_RDONLY in f2fs_handle_critical_error()

2024-09-12 Thread Christoph Hellwig
Another problem is that it sets SB_RDONLY instead of an internal shutdown flag. But that can be solved later. ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Re: [f2fs-dev] [PATCH v5 4/5] sd: limit to use write life hints

2024-09-13 Thread Christoph Hellwig
On Thu, Sep 12, 2024 at 10:01:00PM +0530, Kanchan Joshi wrote: > Please see the response in patch #1. My worries were: > (a) adding a new field and propagating it across the stack will cause > code duplication. > (b) to add a new field we need to carve space within inode, bio and > request. > We

Re: [f2fs-dev] [PATCH v5 4/5] sd: limit to use write life hints

2024-09-16 Thread Christoph Hellwig
On Mon, Sep 16, 2024 at 07:19:21PM +0530, Kanchan Joshi wrote: > > Maybe part of the problem is that the API is very confusing. A smal > > part of that is of course that the existing temperature hints already > > have some issues, but this seems to be taking them make it significantly > > worse. >

Re: [f2fs-dev] [PATCH v4 6/9] f2fs: don't allow DIO reads but not DIO writes

2022-08-21 Thread Christoph Hellwig
On Mon, Aug 15, 2022 at 05:55:45PM -0700, Eric Biggers wrote: > So if the zoned device feature becomes widely adopted, then STATX_DIOALIGN > will > be useless on all Android devices? That sounds undesirable. Are you sure > that We just need to fix f2fs to support direct I/O on zone devices. T

Re: [f2fs-dev] [PATCH v2 0/2] fscrypt: rework filesystem-level keyring

2022-08-22 Thread Christoph Hellwig
ld be good to include with this series for the current merge window, I can then attack the block layer side for the release after that. --- >From e038171b286e2747cbc54e36a8d0e0d6b8a2071e Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Mon, 22 Aug 2022 14:08:52 +0200 Subject: fscrypt: work

Re: [f2fs-dev] [PATCH v5 8/8] xfs: support STATX_DIOALIGN

2022-09-06 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Re: [f2fs-dev] [PATCH v5 2/8] vfs: support STATX_DIOALIGN on block devices

2022-09-06 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Re: [f2fs-dev] [PATCH v4 2/2] f2fs: introduce F2FS_IOC_START_ATOMIC_REPLACE

2022-10-06 Thread Christoph Hellwig
On Tue, Oct 04, 2022 at 10:13:51AM -0700, Daeho Jeong wrote: > From: Daeho Jeong > > introduce a new ioctl to replace the whole content of a file atomically, > which means it induces truncate and content update at the same time. > We can start it with F2FS_IOC_START_ATOMIC_REPLACE and complete it

[f2fs-dev] [PATCH 14/15] f2fs: factor out a f2fs_map_no_dnode

2022-11-28 Thread Christoph Hellwig
Factor out a helper to return a hole when no dnode was found. Signed-off-by: Christoph Hellwig --- fs/f2fs/data.c | 47 --- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index f6124cedd121a2

[f2fs-dev] [PATCH 03/15] f2fs: rename F2FS_MAP_UNWRITTEN to F2FS_MAP_DELALLOC

2022-11-28 Thread Christoph Hellwig
: Christoph Hellwig --- fs/f2fs/data.c | 8 fs/f2fs/f2fs.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 541d625d94be42..444865e0cb6397 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -1638,9 +1638,9 @@ int f2fs_map_blocks

[f2fs-dev] [PATCH 09/15] f2fs: reflow prepare_write_begin

2022-11-28 Thread Christoph Hellwig
Reflow prepare_write_begin so that it reads more straight forward, and so that there is one place that does an extent cache lookup instead of three, two of which are hidden in f2fs_get_block calls. Signed-off-by: Christoph Hellwig --- fs/f2fs/data.c | 57

[f2fs-dev] [PATCH 12/15] f2fs: remove the create argument to f2fs_map_blocks

2022-11-28 Thread Christoph Hellwig
The create argument is always identicaly to map->m_may_create, so use that consistently. Signed-off-by: Christoph Hellwig --- fs/f2fs/data.c | 32 ++-- fs/f2fs/f2fs.h | 3 +-- fs/f2fs/file.c | 12 ++-- include/tr

[f2fs-dev] [PATCH 13/15] f2fs: factor a f2f_map_blocks_cached helper

2022-11-28 Thread Christoph Hellwig
Add a helper to deal with everything needed to return a f2fs_map_blocks structure based on a lookup in the extent cache. Signed-off-by: Christoph Hellwig --- fs/f2fs/data.c | 62 +++--- 1 file changed, 38 insertions(+), 24 deletions(-) diff --git a

[f2fs-dev] [PATCH 02/15] f2fs: decouple F2FS_MAP_ from buffer head flags

2022-11-28 Thread Christoph Hellwig
m_flags is never interchanged with the buffer_heads b_flags directly, so use separate codepoints from that. Signed-off-by: Christoph Hellwig --- fs/f2fs/f2fs.h | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index e6355a5683b75c

[f2fs-dev] [PATCH 10/15] f2fs: simplify __allocate_data_block

2022-11-28 Thread Christoph Hellwig
Just use a simple if block for the conditional call to inc_valid_block_count. Signed-off-by: Christoph Hellwig --- fs/f2fs/data.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index fc5207859912ce..87c17602a3fdd4 100644 --- a/fs

[f2fs-dev] [PATCH 11/15] f2fs: remove f2fs_get_block

2022-11-28 Thread Christoph Hellwig
Fold f2fs_get_block into the two remaining callers to simplify the call chain a bit. Signed-off-by: Christoph Hellwig --- fs/f2fs/data.c | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 87c17602a3fdd4..2ae8fcf7cf49f4

[f2fs-dev] [PATCH 04/15] f2fs: split __submit_bio

2022-11-28 Thread Christoph Hellwig
Split __submit_bio into one function each for reads and writes, and a helper for aligning writes. Signed-off-by: Christoph Hellwig --- fs/f2fs/compress.c | 2 +- fs/f2fs/data.c | 111 +++-- fs/f2fs/f2fs.h | 4 +- 3 files changed, 61 insertions

[f2fs-dev] [PATCH 01/15] f2fs: don't rely on F2FS_MAP_* in f2fs_iomap_begin

2022-11-28 Thread Christoph Hellwig
for direct I/O. Fixes: 1517c1a7a445 ("f2fs: implement iomap operations") Signed-off-by: Christoph Hellwig --- fs/f2fs/data.c | 24 ++-- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index a71e818cd67b43..541d625d94b

[f2fs-dev] [PATCH 15/15] f2fs: refactor the hole reporting and allocation logic in f2fs_map_blocks

2022-11-28 Thread Christoph Hellwig
Add a is_hole local variable to figure out if the block number might need allocation, and untangle to logic to report the hole or fill it with a block allocation. Signed-off-by: Christoph Hellwig --- fs/f2fs/data.c | 113 - 1 file changed, 56

[f2fs-dev] [PATCH 08/15] f2fs: f2fs_do_map_lock

2022-11-28 Thread Christoph Hellwig
Split f2fs_do_map_lock into a lock and unlock helper to make the code using it easier to read. Signed-off-by: Christoph Hellwig --- fs/f2fs/data.c | 46 +++--- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c

[f2fs-dev] [PATCH 07/15] f2fs: add a f2fs_get_block_locked helper

2022-11-28 Thread Christoph Hellwig
This allows to keep the f2fs_do_map_lock based locking scheme private to data.c. Signed-off-by: Christoph Hellwig --- fs/f2fs/data.c | 16 ++-- fs/f2fs/f2fs.h | 3 +-- fs/f2fs/file.c | 4 +--- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs

[f2fs-dev] [PATCH 05/15] f2fs: fold f2fs_lookup_extent_tree into f2fs_lookup_extent_cache

2022-11-28 Thread Christoph Hellwig
No need to keep these two helpers separate. Signed-off-by: Christoph Hellwig --- fs/f2fs/extent_cache.c | 16 +--- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/fs/f2fs/extent_cache.c b/fs/f2fs/extent_cache.c index 932c070173b976..538e4b79f83c9b 100644 --- a/fs/f2fs

[f2fs-dev] [PATCH 06/15] f2fs: add a f2fs_lookup_extent_cache_block helper

2022-11-28 Thread Christoph Hellwig
All but three callers of f2fs_lookup_extent_cache just want the block address. Add a small helper to simplify them. Signed-off-by: Christoph Hellwig --- fs/f2fs/data.c | 29 +++-- fs/f2fs/extent_cache.c | 11 +++ fs/f2fs/f2fs.h | 2 ++ fs/f2fs

[f2fs-dev] a fix and a bunch of cleanups

2022-11-28 Thread Christoph Hellwig
Hi Jaegeuk and Chao, the first patch in this series fixes a warning and subsequent hang when testing zoned f2fs. The other patches are misc cleanups for the I/O path. Diffstat fs/f2fs/compress.c |2 fs/f2fs/data.c | 544 ++-- f

[f2fs-dev] segment allocation cleanups

2022-11-28 Thread Christoph Hellwig
Hi Jaegeuk and Chao, this series cleans up the segment allocation code a bit. Diffstat segment.c | 71 ++ segment.h |6 - 2 files changed, 30 insertions(+), 47 deletions(-) ___ Lin

[f2fs-dev] [PATCH 2/3] f2fs: open code allocate_segment_by_default

2022-11-28 Thread Christoph Hellwig
allocate_segment_by_default has just two callers, which use very different code pathes inside it based on the force paramter. Just open code the logic in the two callers using a new helper to decided if a new segment should be allocated. Signed-off-by: Christoph Hellwig --- fs/f2fs/segment.c

[f2fs-dev] [PATCH 3/3] f2fs: remove the unused flush argument to change_curseg

2022-11-28 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- fs/f2fs/segment.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 2e54df1d3feea5..b3b7ea6559f95e 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -2643,7 +2643,7 @@ bool

[f2fs-dev] [PATCH 1/3] f2fs: remove struct segment_allocation default_salloc_ops

2022-11-28 Thread Christoph Hellwig
There is only single instance of these ops, so remove the indirection and call allocate_segment_by_default directly. Signed-off-by: Christoph Hellwig --- fs/f2fs/segment.c | 11 ++- fs/f2fs/segment.h | 6 -- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/fs/f2fs

Re: [f2fs-dev] [PATCH 12/15] f2fs: remove the create argument to f2fs_map_blocks

2022-12-12 Thread Christoph Hellwig
On Mon, Dec 12, 2022 at 05:22:41PM -0800, Jaegeuk Kim wrote: > > struct dnode_of_data dn; > > @@ -1484,11 +1483,7 @@ int f2fs_map_blocks(struct inode *inode, struct > > f2fs_map_blocks *map, > > pgofs = (pgoff_t)map->m_lblk; > > end = pgofs + maxblocks; > > > > - if (!create && f2f

Re: [f2fs-dev] [RFC PATCH] f2fs: Convert f2fs_write_cache_pages() to use filemap_get_folios_tag()

2022-12-23 Thread Christoph Hellwig
On Wed, Dec 21, 2022 at 09:17:30AM -0800, Vishal Moola wrote: > > That said, folio_ref_inct() is very much MM-internal and filesystems > > should be using folio_get(), so please make that modification in the > > next revision, Vishal. > > Ok, I'll go through and fix all of those in the next versio

Re: [f2fs-dev] a fix and a bunch of cleanups

2023-01-10 Thread Christoph Hellwig
On Tue, Jan 03, 2023 at 09:21:37AM -0800, Jaegeuk Kim wrote: > Hi Christoph, > > I applied the patch set with minor modification to address merge conflict. > Could you please take a look? >From a quick look this looks good. I have a nother big batch of patches that I'll rebase, and as part of th

[f2fs-dev] [PATCH 7/8] f2fs: refactor next blk selection

2023-01-18 Thread Christoph Hellwig
Remove __refresh_next_blkoff by opencoding the SSR vs LFS segment check in the only caller, and then add helpers for SSR block selection and blkoff randomization instead. Signed-off-by: Christoph Hellwig --- fs/f2fs/segment.c | 48 +++ 1 file changed

[f2fs-dev] [PATCH 8/8] f2fs: remove __has_curseg_space

2023-01-18 Thread Christoph Hellwig
Just open code the logic in the only caller, where it is more obvious. Signed-off-by: Christoph Hellwig --- fs/f2fs/segment.c | 19 --- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 6f588e440c7575..4646c2ca2d55c2

[f2fs-dev] [PATCH 1/8] f2fs: remove __add_sum_entry

2023-01-18 Thread Christoph Hellwig
This function just assigns a summary entry. This can be done entirely typesafe with an open code struct assignment that relies on array indexing. Signed-off-by: Christoph Hellwig --- fs/f2fs/segment.c | 23 ++- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a

[f2fs-dev] [PATCH 6/8] f2fs: remove __allocate_new_section

2023-01-18 Thread Christoph Hellwig
Just fold this trivial wrapper into the only caller. Signed-off-by: Christoph Hellwig --- fs/f2fs/segment.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index b25ee37d0375e2..f889f623a59fd6 100644 --- a/fs/f2fs/segment.c +++ b

[f2fs-dev] [PATCH 2/8] f2fs: simplify do_checkpoint

2023-01-18 Thread Christoph Hellwig
For each loop add a local curseg_info pointer insted of looking it up for each of the three fields. Signed-off-by: Christoph Hellwig --- fs/f2fs/checkpoint.c | 22 ++ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c

[f2fs-dev] [PATCH 5/8] f2fs: refactor __allocate_new_segment

2023-01-18 Thread Christoph Hellwig
Simplify the check whether to allocate a new segment or reuse an open one. Signed-off-by: Christoph Hellwig --- fs/f2fs/segment.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index ad323b6e8609cd..b25ee37d0375e2 100644

[f2fs-dev] misc f2fs cleanups

2023-01-18 Thread Christoph Hellwig
Hi all, a bunch of random cleanups found by code inspection. Diffstat: checkpoint.c | 22 - file.c | 60 +++--- segment.c| 134 +-- segment.h|6 -- 4 files changed, 84 insertions(+), 138 de

[f2fs-dev] [PATCH 3/8] f2fs: add a f2fs_curseg_valid_blocks helper

2023-01-18 Thread Christoph Hellwig
Add a helper to return the valid blocks on log and SSR segments, and replace the last two uses of curseg_blkoff with it. Signed-off-by: Christoph Hellwig --- fs/f2fs/segment.c | 32 +++- fs/f2fs/segment.h | 6 -- 2 files changed, 15 insertions(+), 23 deletions

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

2023-01-18 Thread Christoph Hellwig
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 +- 1 file changed, 25 insertions(+), 35 deletions(-) diff --git a/fs

Re: [f2fs-dev] [PATCH v2 10/11] fs/buffer.c: support fsverity in block_read_full_folio()

2023-01-20 Thread Christoph Hellwig
On Fri, Jan 20, 2023 at 11:56:45AM -0800, Eric Biggers wrote: > Any more thoughts on this from Andrew, the ext4 maintainers, or anyone else? As someone else: I relaly much prefer to support common functionality (fsverity) in common helpers rather than copy and pasting them into various file syste

Re: [f2fs-dev] [PATCH 00/12] acl: remove remaining posix acl handlers

2023-01-30 Thread Christoph Hellwig
On Mon, Jan 30, 2023 at 10:10:52AM +0100, Christian Brauner wrote: > However, a few filesystems still rely on the ->list() method of the > generix POSIX ACL xattr handlers in their ->listxattr() inode operation. > This is a very limited set of filesystems. For most of them there is no > dependence

Re: [f2fs-dev] [PATCH v2 6/8] fs: simplify ->listxattr() implementation

2023-01-30 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Re: [f2fs-dev] [PATCH v3 00/10] acl: drop posix acl handlers from xattr handlers

2023-02-01 Thread Christoph Hellwig
This version looks good to me, but I'd really prefer if a reiserfs insider could look over the reiserfs patches. ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

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

2023-03-20 Thread Christoph Hellwig
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 > implement proper direct IO? I don't think why

Re: [f2fs-dev] [PATCH] f2fs: compress: fix to wait page writeback in f2fs_write_raw_pages()

2023-03-20 Thread Christoph Hellwig
On Thu, Mar 16, 2023 at 05:36:32PM +0800, Yangtao Li wrote: > + if (PageWriteback(cc->rpages[i])) { > + if (wbc->sync_mode != WB_SYNC_NONE) > + f2fs_wait_on_page_writeback(cc->rpages[i], > + DATA

Re: [f2fs-dev] [PATCH v2 05/23] fsverity: make fsverity_verify_folio() accept folio's offset and size

2023-04-04 Thread Christoph Hellwig
On Tue, Apr 04, 2023 at 04:53:01PM +0200, Andrey Albershteyn wrote: > Not the whole folio always need to be verified by fs-verity (e.g. > with 1k blocks). Use passed folio's offset and size. Why can't those callers just call fsverity_verify_blocks directly? __

Re: [f2fs-dev] [PATCH v2 08/23] iomap: hoist iomap_readpage_ctx from the iomap_readahead/_folio

2023-04-04 Thread Christoph Hellwig
On Tue, Apr 04, 2023 at 04:53:04PM +0200, Andrey Albershteyn wrote: > Make filesystems create readpage context, similar as > iomap_writepage_ctx in write path. This will allow filesystem to > pass _ops to iomap for ioend configuration (->prepare_ioend) which > in turn would be used to set BIO end c

Re: [f2fs-dev] [PATCH v2 09/23] iomap: allow filesystem to implement read path verification

2023-04-04 Thread Christoph Hellwig
> if (iomap_block_needs_zeroing(iter, pos)) { > folio_zero_range(folio, poff, plen); > + if (iomap->flags & IOMAP_F_READ_VERITY) { Wju do we need the new flag vs just testing that folio_ops and folio_ops->verify_folio is non-NULL? > - ctx->bio = bio_all

Re: [f2fs-dev] [PATCH v2 05/23] fsverity: make fsverity_verify_folio() accept folio's offset and size

2023-04-05 Thread Christoph Hellwig
On Wed, Apr 05, 2023 at 12:36:42PM +0200, Andrey Albershteyn wrote: > Hi Christoph, > > On Tue, Apr 04, 2023 at 08:30:36AM -0700, Christoph Hellwig wrote: > > On Tue, Apr 04, 2023 at 04:53:01PM +0200, Andrey Albershteyn wrote: > > > Not the whole folio always need to be ve

Re: [f2fs-dev] [PATCH v2 09/23] iomap: allow filesystem to implement read path verification

2023-04-05 Thread Christoph Hellwig
On Wed, Apr 05, 2023 at 08:06:27AM -0700, Darrick J. Wong wrote: > > > I wonder if that also makes sense and keep all the deferral in the > > > file system. We'll need that for the btrfs iomap conversion anyway, > > > and it seems more flexible. The ioend processing would then move into > > > XFS

  1   2   3   4   5   6   7   8   9   >