Re: [Cluster-devel] [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?

Re: [Cluster-devel] [PATCH 03/12] filemap: update ki_pos in generic_perform_write

2023-08-28 Thread Christoph Hellwig
tten. > > Or am I completely misparsing what you've written? No, I misread the patch. Looks good: Acked-by: Christoph Hellwig

Re: [Cluster-devel] [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

Re: [Cluster-devel] [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: [Cluster-devel] allow building a kernel without buffer_heads

2023-07-21 Thread Christoph Hellwig
On Thu, Jul 20, 2023 at 09:51:30AM -0500, Bob Peterson wrote: > Gfs2 still uses buffer_heads to manage the metadata being pushed through > its journals. We've been reducing our dependency on them but eliminating > them altogether is a large and daunting task. We can still work toward that >

Re: [Cluster-devel] [PATCH 16/17] block: use iomap for writes to block devices

2023-07-20 Thread Christoph Hellwig
On Wed, May 24, 2023 at 02:33:13PM +0100, Matthew Wilcox wrote: > As you can see, do_page_cache_ra() does limit readahead to i_size. > Is ractl->mapping->host the correct way to find the inode? I always > get confused. As far as I can tell it is the right inode, the indirection through

Re: [Cluster-devel] [PATCH 16/17] block: use iomap for writes to block devices

2023-07-20 Thread Christoph Hellwig
On Fri, May 19, 2023 at 04:22:01PM +0200, Hannes Reinecke wrote: > I'm hitting this during booting: > [5.016324] > [5.030256] iomap_iter+0x11a/0x350 > [5.030264] iomap_readahead+0x1eb/0x2c0 > [5.030272] read_pages+0x5d/0x220 > [5.030279]

Re: [Cluster-devel] [LTP] [linus:master] [iomap] 219580eea1: ltp.writev07.fail

2023-07-13 Thread Christoph Hellwig
On Thu, Jul 13, 2023 at 05:34:55PM +0200, Cyril Hrubis wrote: > iter.processed = iomap_write_iter(, i); > > + iocb->ki_pos += iter.pos - iocb->ki_pos; > + > if (unlikely(ret < 0)) > return ret; > - ret = iter.pos - iocb->ki_pos; > -

[Cluster-devel] [PATCH] gfs2: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method

2023-06-11 Thread Christoph Hellwig
pen_common for regular files that do not use data journalling. Signed-off-by: Christoph Hellwig --- fs/gfs2/aops.c | 1 - fs/gfs2/file.c | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c index a5f4be6b9213ed..d95125714ebb38 100644 --- a/fs/gfs2/ao

Re: [Cluster-devel] [PATCH 09/12] fs: factor out a direct_write_fallback helper

2023-06-06 Thread Christoph Hellwig
On Mon, Jun 05, 2023 at 05:04:14PM -0700, Darrick J. Wong wrote: > On Thu, Jun 01, 2023 at 04:59:01PM +0200, Christoph Hellwig wrote: > > Add a helper dealing with handling the syncing of a buffered write fallback > > for direct I/O. > > > > Signed-off-by: Chri

[Cluster-devel] [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

[Cluster-devel] [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 M

[Cluster-devel] [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

[Cluster-devel] [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

[Cluster-devel] [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

[Cluster-devel] [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

[Cluster-devel] [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

[Cluster-devel] [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

[Cluster-devel] [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

[Cluster-devel] 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

[Cluster-devel] [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

[Cluster-devel] [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

[Cluster-devel] [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

Re: [Cluster-devel] [PATCH 10/12] fuse: update ki_pos in fuse_perform_write

2023-06-01 Thread Christoph Hellwig
On Wed, May 31, 2023 at 11:11:13AM +0200, Miklos Szeredi wrote: > Why remove generic_write_sync()? Definitely doesn't belong in this > patch even if there's a good reason. Yes, this shouldn't have happened. I think this was a bad merge resolution after the current->backing_dev removal.

Re: [Cluster-devel] [PATCH v7 19/20] fs: iomap: use bio_add_folio_nofail where possible

2023-05-31 Thread Christoph Hellwig
On Thu, Jun 01, 2023 at 08:36:59AM +1000, Dave Chinner wrote: > We lose adjacent page merging with this change. This is only used for adding the first folio to a brand new bio, so there is nothing to merge with yet at this point.

Re: [Cluster-devel] [PATCH v7 20/20] block: mark bio_add_folio as __must_check

2023-05-31 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig

Re: [Cluster-devel] [PATCH v7 17/20] block: mark bio_add_page as __must_check

2023-05-31 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig

Re: [Cluster-devel] [PATCH v7 18/20] block: add bio_add_folio_nofail

2023-05-31 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig

[Cluster-devel] [PATCH 3/8] filemap: update ki_pos in generic_perform_write

2023-05-31 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: Darrick J. Wong --- fs/ceph/file.c | 2 -- fs/ext4/file.c | 9 +++-- fs/f2fs

[Cluster-devel] [PATCH 01/12] backing_dev: remove current->backing_dev_info

2023-05-31 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: Hannes Reinecke Reviewed-by: Darrick J.

[Cluster-devel] cleanup the filemap / direct I/O interaction v3

2023-05-31 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

[Cluster-devel] [PATCH 2/8] iomap: update ki_pos a little later in iomap_dio_complete

2023-05-31 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

[Cluster-devel] [PATCH 08/12] iomap: use kiocb_write_and_wait and kiocb_invalidate_pages

2023-05-31 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

[Cluster-devel] [PATCH 6/8] filemap: add a kiocb_invalidate_post_direct_write helper

2023-05-31 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

[Cluster-devel] [PATCH 06/12] filemap: add a kiocb_invalidate_post_direct_write helper

2023-05-31 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

[Cluster-devel] [PATCH 4/8] filemap: add a kiocb_write_and_wait helper

2023-05-31 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

[Cluster-devel] [PATCH 05/12] filemap: add a kiocb_invalidate_pages helper

2023-05-31 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

[Cluster-devel] [PATCH 12/12] fuse: use direct_write_fallback

2023-05-31 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

[Cluster-devel] [PATCH 1/8] backing_dev: remove current->backing_dev_info

2023-05-31 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: Hannes Reinecke Reviewed-by: Darrick J.

[Cluster-devel] [PATCH 09/12] fs: factor out a direct_write_fallback helper

2023-05-31 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 --- fs/libfs.c | 41 include/linux/fs.h | 2 ++ mm/filemap.c | 66 +++--- 3 files

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

2023-05-31 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

[Cluster-devel] [PATCH 5/8] filemap: add a kiocb_invalidate_pages helper

2023-05-31 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

[Cluster-devel] [PATCH 03/12] filemap: update ki_pos in generic_perform_write

2023-05-31 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: Darrick J. Wong --- fs/ceph/file.c | 2 -- fs/ext4/file.c | 9 +++-- fs/f2fs

[Cluster-devel] [PATCH 8/8] iomap: use kiocb_write_and_wait and kiocb_invalidate_pages

2023-05-31 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

[Cluster-devel] cleanup the filemap / direct I/O interaction v3 (full series now)

2023-05-31 Thread Christoph Hellwig
[Sorry for the previous attempt that stopped at patch 8] 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

[Cluster-devel] [PATCH 07/12] iomap: update ki_pos in iomap_file_buffered_write

2023-05-31 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

[Cluster-devel] [PATCH 7/8] iomap: update ki_pos in iomap_file_buffered_write

2023-05-31 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

[Cluster-devel] [PATCH 04/12] filemap: add a kiocb_write_and_wait helper

2023-05-31 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

[Cluster-devel] [PATCH 10/12] fuse: update ki_pos in fuse_perform_write

2023-05-31 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 | 23 ++- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c

[Cluster-devel] [PATCH 11/12] fuse: drop redundant arguments to fuse_perform_write

2023-05-31 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

Re: [Cluster-devel] [PATCH v6 08/20] jfs: logmgr: use __bio_add_page to add single page to bio

2023-05-30 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig

Re: [Cluster-devel] [PATCH v6 20/20] block: mark bio_add_folio as __must_check

2023-05-30 Thread Christoph Hellwig
On Tue, May 30, 2023 at 08:49:23AM -0700, Johannes Thumshirn wrote: > +bool __must_check bio_add_folio(struct bio *, struct folio *, size_t len, > size_t off); Please spell out the parameters and avoid the overly long line.

Re: [Cluster-devel] [PATCH v6 19/20] fs: iomap: use __bio_add_folio where possible

2023-05-30 Thread Christoph Hellwig
a newly created bio can't fail, use the newly > introduced __bio_add_folio() function. Looks good: Reviewed-by: Christoph Hellwig

Re: [Cluster-devel] [PATCH v6 18/20] block: add __bio_add_folio

2023-05-30 Thread Christoph Hellwig
On Tue, May 30, 2023 at 08:49:21AM -0700, Johannes Thumshirn wrote: > Just like for bio_add_pages() add a no-fail variant for bio_add_folio(). Can we call this bio_add_folio_nofail? I really regret the __ prefix for bio_add_page these days - it wasn't really intended to be used as widely

Re: [Cluster-devel] [PATCH v6 17/20] block: mark bio_add_page as __must_check

2023-05-30 Thread Christoph Hellwig
> +int __must_check bio_add_page(struct bio *, struct page *, unsigned len, > unsigned off); Please spell out all parameters while you touch this, and also avoid the overly long line.

Re: [Cluster-devel] [PATCH v6 15/20] md: raid1: check if adding pages to resync bio fails

2023-05-30 Thread Christoph Hellwig
To me these look like __bio_add_page candidates, but I guess Song preferred it this way? It'll add a bit pointless boilerplate code, but I'm ok with that.

Re: [Cluster-devel] [PATCH v6 10/20] zonefs: use __bio_add_page for adding single page to bio

2023-05-30 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig

Re: [Cluster-devel] [PATCH v6 14/20] md: raid1: use __bio_add_page for adding single page to bio

2023-05-30 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig

Re: [Cluster-devel] [PATCH v6 13/20] md: check for failure when adding pages in alloc_behind_master_bio

2023-05-30 Thread Christoph Hellwig
if not bail out. > > Reviewed-by: Damien Le Moal > Signed-off-by: Johannes Thumshirn Looks good: Reviewed-by: Christoph Hellwig

Re: [Cluster-devel] [PATCH v6 12/20] floppy: use __bio_add_page for adding single page to bio

2023-05-30 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig

Re: [Cluster-devel] [PATCH v6 11/20] zram: use __bio_add_page for adding single page to bio

2023-05-30 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig

Re: [Cluster-devel] [PATCH v6 09/20] gfs2: use __bio_add_page for adding single page to bio

2023-05-30 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig

Re: [Cluster-devel] [PATCH v6 07/20] md: raid5: use __bio_add_page to add single page to new bio

2023-05-30 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig

Re: [Cluster-devel] [PATCH v6 06/20] md: raid5-log: use __bio_add_page to add single page

2023-05-30 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig

Re: [Cluster-devel] [PATCH v6 04/20] fs: buffer: use __bio_add_page to add single page to bio

2023-05-30 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig

Re: [Cluster-devel] [PATCH v6 05/20] md: use __bio_add_page to add single page

2023-05-30 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig

Re: [Cluster-devel] [PATCH v6 01/20] swap: use __bio_add_page to add page to bio

2023-05-30 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig

Re: [Cluster-devel] [PATCH 06/32] sched: Add task_struct->faults_disabled_mapping

2023-05-26 Thread Christoph Hellwig
On Thu, May 25, 2023 at 04:50:39PM -0400, Kent Overstreet wrote: > A cache that isn't actually consistent is a _bug_. You're being > Obsequious. And any time this has come up in previous discussions > (including at LSF), that was never up for debate, the only question has > been whether it was

Re: [Cluster-devel] [PATCH 06/32] sched: Add task_struct->faults_disabled_mapping

2023-05-26 Thread Christoph Hellwig
On Thu, May 25, 2023 at 07:20:46PM -0400, Kent Overstreet wrote: > > > I'm absolutely not in favour to add workarounds for thes kind of locking > > > problems to the core kernel. I already feel bad for allowing the > > > small workaround in iomap for btrfs, as just fixing the locking back > > >

Re: [Cluster-devel] [PATCH 09/11] fs: factor out a direct_write_fallback helper

2023-05-25 Thread Christoph Hellwig
On Wed, May 24, 2023 at 09:00:36AM +0200, Miklos Szeredi wrote: > > +ssize_t direct_write_fallback(struct kiocb *iocb, struct iov_iter *iter, > > + ssize_t direct_written, ssize_t buffered_written) > > +{ > > + struct address_space *mapping = iocb->ki_filp->f_mapping; > > +

Re: [Cluster-devel] [PATCH 10/11] fuse: update ki_pos in fuse_perform_write

2023-05-25 Thread Christoph Hellwig
On Wed, May 24, 2023 at 09:07:22AM +0200, Miklos Szeredi wrote: > > - endbyte = pos + written_buffered - 1; > > + endbyte = iocb->ki_pos + written_buffered - 1; > > Wrong endpos. > > > > > - err = filemap_write_and_wait_range(file->f_mapping, pos, > > +

Re: [Cluster-devel] [PATCH 06/32] sched: Add task_struct->faults_disabled_mapping

2023-05-25 Thread Christoph Hellwig
On Wed, May 24, 2023 at 04:09:02AM -0400, Kent Overstreet wrote: > > Well, it seems like you are talking about something else than the > > existing cases in gfs2 and btrfs, that is you want full consistency > > between direct I/O and buffered I/O. That's something nothing in the > > kernel has

[Cluster-devel] [PATCH 07/11] iomap: update ki_pos in iomap_file_buffered_write

2023-05-24 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 Acked-by: Damien Le Moal Reviewed-by: Darrick J. Wong --- fs/gfs2/file.c | 4 +--- fs/iomap/buffered-io.c | 9 ++--- fs/xfs/xfs_file.c | 2 -- fs/zonefs

[Cluster-devel] [PATCH 02/11] iomap: update ki_pos a little later in iomap_dio_complete

2023-05-24 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: Darrick J. Wong --- fs/iomap/direct-io.c | 21 +++-- 1 file changed, 11 insertions(+), 10

[Cluster-devel] [PATCH 08/11] iomap: use kiocb_write_and_wait and kiocb_invalidate_pages

2023-05-24 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: Darrick J. Wong --- fs/iomap/direct

[Cluster-devel] [PATCH 04/11] filemap: add a kiocb_write_and_wait helper

2023-05-24 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 Acked-by: Darrick J. Wong --- block/fops.c

[Cluster-devel] [PATCH 09/11] fs: factor out a direct_write_fallback helper

2023-05-24 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 --- fs/libfs.c | 36 + include/linux/fs.h | 2 ++ mm/filemap.c | 66 +++--- 3 files changed

[Cluster-devel] [PATCH 03/11] filemap: update ki_pos in generic_perform_write

2023-05-24 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 Acked-by: Darrick J. Wong --- fs/ceph/file.c | 2 -- fs/ext4/file.c | 9 +++-- fs/f2fs/file.c | 1 - fs/nfs/file.c

[Cluster-devel] [PATCH 06/11] filemap: add a kiocb_invalidate_post_direct_write helper

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

[Cluster-devel] [PATCH 11/11] fuse: drop redundant arguments to fuse_perform_write

2023-05-24 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 --- fs/fuse/file.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/fs/fuse/file.c b/fs/fuse/fil

[Cluster-devel] cleanup the filemap / direct I/O interaction v2

2023-05-24 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

[Cluster-devel] [PATCH 10/11] fuse: update ki_pos in fuse_perform_write

2023-05-24 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 | 25 +++-- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c

[Cluster-devel] [PATCH 01/11] backing_dev: remove current->backing_dev_info

2023-05-24 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 --- fs/btrfs/file.c | 6 +- fs/ceph/file

[Cluster-devel] [PATCH 05/11] filemap: add a kiocb_invalidate_pages helper

2023-05-24 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

Re: [Cluster-devel] [PATCH 06/32] sched: Add task_struct->faults_disabled_mapping

2023-05-24 Thread Christoph Hellwig
On Tue, May 23, 2023 at 12:35:35PM -0400, Kent Overstreet wrote: > No, this is fundamentally because userspace controls the ordering of > locking because the buffer passed to dio can point into any address > space. You can't solve this by changing the locking heirarchy. > > If you want to be able

Re: [Cluster-devel] [PATCH 06/32] sched: Add task_struct->faults_disabled_mapping

2023-05-23 Thread Christoph Hellwig
On Tue, May 23, 2023 at 03:34:31PM +0200, Jan Kara wrote: > I've checked the code and AFAICT it is all indeed handled. BTW, I've now > remembered that GFS2 has dealt with the same deadlocks - b01b2d72da25 > ("gfs2: Fix mmap + page fault deadlocks for direct I/O") - in a different > way (by

Re: [Cluster-devel] [PATCH 10/13] fs: factor out a direct_write_fallback helper

2023-05-23 Thread Christoph Hellwig
On Mon, May 22, 2023 at 04:19:38PM +0200, Miklos Szeredi wrote: > > + ssize_t direct_written, ssize_t buffered_written) > > +{ > > + struct address_space *mapping = iocb->ki_filp->f_mapping; > > + loff_t pos = iocb->ki_pos, end; > > At this point pos will point after the

Re: [Cluster-devel] [PATCH 08/13] iomap: assign current->backing_dev_info in iomap_file_buffered_write

2023-05-23 Thread Christoph Hellwig
On Tue, May 23, 2023 at 04:30:51AM +0100, Matthew Wilcox wrote: > AFAICT (the code went through some metamorphoses in the intervening > twenty years), the last use of it ended up in current_may_throttle(), > and it was removed in March 2022 by Neil Brown in commit b9b1335e6403. > Since then, there

Re: [Cluster-devel] [PATCH 07/13] iomap: update ki_pos in iomap_file_buffered_write

2023-05-23 Thread Christoph Hellwig
On Mon, May 22, 2023 at 09:01:05AM +0900, Damien Le Moal wrote: > > - int ret; > > + ssize_t ret; > > > > if (iocb->ki_flags & IOCB_NOWAIT) > > iter.flags |= IOMAP_NOWAIT; > > > > while ((ret = iomap_iter(, ops)) > 0) > > iter.processed = iomap_write_iter(,

Re: [Cluster-devel] [PATCH 06/13] filemap: add a kiocb_invalidate_post_write helper

2023-05-23 Thread Christoph Hellwig
On Mon, May 22, 2023 at 08:56:34AM +0900, Damien Le Moal wrote: > On 5/19/23 18:35, Christoph Hellwig wrote: > > Add a helper to invalidate page cache after a dio write. > > > > Signed-off-by: Christoph Hellwig > > Nit: kiocb_invalidate_post_dio_write() may be a

[Cluster-devel] [PATCH 10/13] fs: factor out a direct_write_fallback helper

2023-05-19 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 --- fs/libfs.c | 36 include/linux/fs.h | 2 ++ mm/filemap.c | 59 ++ 3 files

[Cluster-devel] [PATCH 07/13] iomap: update ki_pos in iomap_file_buffered_write

2023-05-19 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 --- fs/gfs2/file.c | 4 +--- fs/iomap/buffered-io.c | 9 ++--- fs/xfs/xfs_file.c | 2 -- fs/zonefs/file.c | 4 +--- 4 files changed, 8 insertions

[Cluster-devel] [PATCH 06/13] filemap: add a kiocb_invalidate_post_write helper

2023-05-19 Thread Christoph Hellwig
Add a helper to invalidate page cache after a dio write. Signed-off-by: Christoph Hellwig --- fs/direct-io.c | 10 ++ fs/iomap/direct-io.c| 12 ++-- include/linux/fs.h | 5 - include/linux/pagemap.h | 1 + mm/filemap.c| 37

[Cluster-devel] cleanup the filemap / direct I/O interaction

2023-05-19 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 while we'll want to an use iomap based buffered write path in the block layer. diffstat:

[Cluster-devel] [PATCH 11/13] fuse: update ki_pos in fuse_perform_write

2023-05-19 Thread Christoph Hellwig
Both callers of fuse_perform_write need to updated ki_pos, move it into common code. Signed-off-by: Christoph Hellwig --- fs/fuse/file.c | 25 +++-- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 89d97f6188e05e

[Cluster-devel] [PATCH 05/13] filemap: add a kiocb_invalidate_pages helper

2023-05-19 Thread Christoph Hellwig
Factor out a helper that calls filemap_write_and_wait_range and invalidate_inode_pages2_rangefor a 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 --- include/linux/pagemap.h

[Cluster-devel] [PATCH 02/13] filemap: update ki_pos in generic_perform_write

2023-05-19 Thread Christoph Hellwig
All callers of generic_perform_write need to updated ki_pos, move it into common code. Signed-off-by: Christoph Hellwig --- fs/ceph/file.c | 2 -- fs/ext4/file.c | 9 +++-- fs/f2fs/file.c | 1 - fs/nfs/file.c | 1 - mm/filemap.c | 8 5 files changed, 7 insertions(+), 14

[Cluster-devel] [PATCH 08/13] iomap: assign current->backing_dev_info in iomap_file_buffered_write

2023-05-19 Thread Christoph Hellwig
Move the assignment to current->backing_dev_info from the callers into iomap_file_buffered_write to reduce boiler plate code and reduce the scope to just around the page dirtying loop. Note that zonefs was missing this assignment before. Signed-off-by: Christoph Hellwig --- fs/gfs2/fil

[Cluster-devel] [PATCH 09/13] iomap: use kiocb_write_and_wait and kiocb_invalidate_pages

2023-05-19 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 --- fs/iomap/direct-io.c | 55 1

[Cluster-devel] [PATCH 04/13] filemap: add a kiocb_write_and_wait helper

2023-05-19 Thread Christoph Hellwig
Factor out a helper that does filemap_write_and_wait_range for a 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 --- block/fops.c| 18 +++--- include/linux

  1   2   3   4   5   6   7   8   9   10   >