Re: [Cluster-devel] [PATCH 02/17] fs: remove the special !CONFIG_BLOCK def_blk_fops

2023-04-24 Thread Randy Dunlap
Hi, On 4/23/23 22:49, Christoph Hellwig wrote: > def_blk_fops always returns -ENODEV, which dosn't match the return value > of a non-existing block device with CONFIG_BLOCK, which is -ENXIO. > Just remove the extra implementation and fall back to the default > no_open_fops that always returns

Re: [Cluster-devel] [PATCH 02/17] fs: remove the special !CONFIG_BLOCK def_blk_fops

2023-04-24 Thread Keith Busch
On Mon, Apr 24, 2023 at 12:22:30PM -0700, Randy Dunlap wrote: > On 4/23/23 22:49, Christoph Hellwig wrote: > > + if (IS_ENABLED(CONFIG_BLOCK)) > > + inode->i_fop = _blk_fops; > > It looks like def_blk_fops is being removed (commit message and patch > fragment below),

Re: [Cluster-devel] [PATCH 05/17] filemap: update ki_pos in generic_perform_write

2023-04-24 Thread Andreas Gruenbacher
On Mon, Apr 24, 2023 at 8:22 AM Christoph Hellwig wrote: > All callers of generic_perform_write need to updated ki_pos, move it into > common code. We've actually got a similar situation with iomap_file_buffered_write() and its callers. Would it make sense to fix that up as well? >

Re: [Cluster-devel] [GFS2 PATCH 2/4] gfs2: Perform second log flush in gfs2_make_fs_ro

2023-04-24 Thread Bob Peterson
On 4/24/23 10:08 AM, Andreas Gruenbacher wrote: point the GFS2_LOG_HEAD_FLUSH_SHUTDOWN has been set by gfs2_make_fs_ro. Do you mean that at that point, the SDF_JOURNAL_LIVE flag has already been cleared? Ah, yes, you are correct. That was a think-o. Please adjust as appropriate. Regards,

Re: [Cluster-devel] [GFS2 PATCH 2/4] gfs2: Perform second log flush in gfs2_make_fs_ro

2023-04-24 Thread Andreas Gruenbacher
On Fri, Apr 21, 2023 at 9:07 PM Bob Peterson wrote: > Before this patch function gfs2_make_fs_ro called gfs2_log_flush once to > finalize the log. However, if there's dirty metadata, log flushes tend > to sync the metadata and formulate revokes. Before this patch, those > revokes may not be

Re: [Cluster-devel] [GFS2 PATCH 1/4] gfs2: return errors from gfs2_ail_empty_gl

2023-04-24 Thread Andreas Gruenbacher
On Fri, Apr 21, 2023 at 9:07 PM Bob Peterson wrote: > Before this patch, function gfs2_ail_empty_gl did not return errors it > encountered from __gfs2_trans_begin. Those errors usually came from the > fact that the file system was made read-only, often due to unmount, > (but theoretically could

Re: [Cluster-devel] [PATCH 03/17] fs: rename and move block_page_mkwrite_return

2023-04-24 Thread Christoph Hellwig
On Mon, Apr 24, 2023 at 01:30:56PM +0100, Matthew Wilcox wrote: > On Mon, Apr 24, 2023 at 07:49:12AM +0200, Christoph Hellwig wrote: > > block_page_mkwrite_return is neither block nor mkwrite specific, and > > should not be under CONFIG_BLOCK. Move it to mm.h and rename it to > >

Re: [Cluster-devel] [PATCH 03/17] fs: rename and move block_page_mkwrite_return

2023-04-24 Thread Matthew Wilcox
On Mon, Apr 24, 2023 at 07:49:12AM +0200, Christoph Hellwig wrote: > block_page_mkwrite_return is neither block nor mkwrite specific, and > should not be under CONFIG_BLOCK. Move it to mm.h and rename it to > errno_to_vmfault. Could you move it about 300 lines down and put it near vmf_error() so

Re: [Cluster-devel] question about gfs2 multiple device support

2023-04-24 Thread Wang Yugui
Hi, > Hi, > > On Sat, 2023-04-22 at 09:20 +0800, Wang Yugui wrote: > > Hi, > > > > Is there some work for gfs2 multiple device support? > > > Do you mean multiple devices generically, or specifically the md > driver? > > > if multiple device support, > > 1, No need of RAID 0/1/5/6 support. >

Re: [Cluster-devel] question about gfs2 multiple device support

2023-04-24 Thread Steven Whitehouse
Hi, On Sat, 2023-04-22 at 09:20 +0800, Wang Yugui wrote: > Hi, > > Is there some work for gfs2 multiple device support? > Do you mean multiple devices generically, or specifically the md driver? > if multiple device support, > 1, No need of RAID 0/1/5/6 support. >    nvme SSD is fast enough

[Cluster-devel] question about gfs2 multiple device support

2023-04-24 Thread Wang Yugui
Hi, Is there some work for gfs2 multiple device support? if multiple device support, 1, No need of RAID 0/1/5/6 support. nvme SSD is fast enough for single thread write. 2, can we limit one journal into one device? 3, can we just write lock one device, so better write throughput? Best

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

2023-04-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 | 59 ++ 3 files

[Cluster-devel] [PATCH 04/17] fs: remove emergency_thaw_bdev

2023-04-24 Thread Christoph Hellwig
Fold emergency_thaw_bdev into it's only caller, to prepare for buffer.c to be built only when buffer_head support is enabled. Signed-off-by: Christoph Hellwig --- fs/buffer.c | 6 -- fs/internal.h | 6 -- fs/super.c| 4 +++- 3 files changed, 3 insertions(+), 13 deletions(-) diff

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

2023-04-24 Thread Christoph Hellwig
Use iomap in buffer_head compat mode to write to block devices. Signed-off-by: Christoph Hellwig --- block/Kconfig | 1 + block/fops.c | 33 + 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/block/Kconfig b/block/Kconfig index

[Cluster-devel] [PATCH 07/17] filemap: add a kiocb_invalidate_pages helper

2023-04-24 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] RFC: allow building a kernel without buffer_heads

2023-04-24 Thread Christoph Hellwig
Hi all, after all the talk about removing buffer_heads, here is a series that shows how to build a kernel without buffer_heads. And how unrealistic it is to remove the entirely. Most of the series refactors some common code to make implementing direct I/O easier without use of the ->direct_IO

[Cluster-devel] [PATCH 05/17] filemap: update ki_pos in generic_perform_write

2023-04-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 --- 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 14/17] block: open code __generic_file_write_iter for blkdev writes

2023-04-24 Thread Christoph Hellwig
Open code __generic_file_write_iter to remove the indirect call into ->direct_IO and to prepare using the iomap based write code. Signed-off-by: Christoph Hellwig --- block/fops.c | 46 -- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git

[Cluster-devel] [PATCH 08/17] filemap: add a kiocb_invalidate_post_write helper

2023-04-24 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] [PATCH 03/17] fs: rename and move block_page_mkwrite_return

2023-04-24 Thread Christoph Hellwig
block_page_mkwrite_return is neither block nor mkwrite specific, and should not be under CONFIG_BLOCK. Move it to mm.h and rename it to errno_to_vmfault. Signed-off-by: Christoph Hellwig --- fs/ext4/inode.c | 2 +- fs/f2fs/file.c | 2 +- fs/gfs2/file.c |

[Cluster-devel] [PATCH 13/17] block: don't plug in blkdev_write_iter

2023-04-24 Thread Christoph Hellwig
Remove the no needed plug in blkdev_write_iter. For direct I/O that issues more than a single I/O, the plug is already done in __blkdev_direct_IO, and for synchronous buffered writes, the plug is done in writeback_inodes_wb / wb_writeback, while for the other cases a plug doesn't make sense.

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

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

[Cluster-devel] [PATCH 02/17] fs: remove the special !CONFIG_BLOCK def_blk_fops

2023-04-24 Thread Christoph Hellwig
def_blk_fops always returns -ENODEV, which dosn't match the return value of a non-existing block device with CONFIG_BLOCK, which is -ENXIO. Just remove the extra implementation and fall back to the default no_open_fops that always returns -ENXIO. Signed-off-by: Christoph Hellwig --- fs/Makefile

[Cluster-devel] [PATCH 15/17] block: stop setting ->direct_IO

2023-04-24 Thread Christoph Hellwig
Direct I/O on block devices now nevers goes through aops->direct_IO. Stop setting it and set the FMODE_CAN_ODIRECT in ->open instead. Signed-off-by: Christoph Hellwig --- block/fops.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/block/fops.c b/block/fops.c index

[Cluster-devel] [PATCH 11/17] iomap: assign current->backing_dev_info in iomap_file_buffered_write

2023-04-24 Thread Christoph Hellwig
Move the assignment to current->backing_dev_info from the callers into iomap_file_buffered_write. Note that zonefs was missing this assignment before. Signed-off-by: Christoph Hellwig --- fs/gfs2/file.c | 3 --- fs/iomap/buffered-io.c | 4 fs/xfs/xfs_file.c | 5 - 3 files

[Cluster-devel] [PATCH 01/17] fs: unexport buffer_check_dirty_writeback

2023-04-24 Thread Christoph Hellwig
buffer_check_dirty_writeback is only used by the block device aops, remove the export. Signed-off-by: Christoph Hellwig --- fs/buffer.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/buffer.c b/fs/buffer.c index 9e1e2add541e07..eb14fbaa7d35f7 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@

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

2023-04-24 Thread Christoph Hellwig
On Sun, Apr 23, 2023 at 11:18:25PM -0700, Darrick J. Wong wrote: > > @@ -876,8 +877,11 @@ iomap_file_buffered_write(struct kiocb *iocb, struct > > iov_iter *i, > > if (iocb->ki_flags & IOCB_NOWAIT) > > iter.flags |= IOMAP_NOWAIT; > > > > + current->backing_dev_info =

[Cluster-devel] [PATCH 06/17] filemap: add a kiocb_write_and_wait helper

2023-04-24 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 +++---

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

2023-04-24 Thread Christoph Hellwig
Refator the fuse direct write code so that the fuse_perform_write callig convention is simplified to match generic_perform_write and it's updating ki_pos directly, and the generic direct_write_fallback helper is used to consolidate buffered I/O fallback code. Signed-off-by: Christoph Hellwig ---

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

2023-04-24 Thread Darrick J. Wong
On Mon, Apr 24, 2023 at 07:49:20AM +0200, Christoph Hellwig wrote: > Move the assignment to current->backing_dev_info from the callers into > iomap_file_buffered_write. Note that zonefs was missing this assignment > before. > > Signed-off-by: Christoph Hellwig > --- > fs/gfs2/file.c |