[Cluster-devel] [PATCH 22/27] iomap: pass an iomap_iter to various buffered I/O helpers

2021-07-19 Thread Christoph Hellwig
Pass the iomap_iter structure instead of individual parameters to various internal helpers for buffered I/O. Signed-off-by: Christoph Hellwig --- fs/iomap/buffered-io.c | 117 - 1 file changed, 56 insertions(+), 61 deletions(-) diff --git a/fs/iomap

[Cluster-devel] [PATCH 21/27] iomap: remove iomap_apply

2021-07-19 Thread Christoph Hellwig
iomap_apply is unused now, so remove it. Signed-off-by: Christoph Hellwig --- fs/iomap/Makefile | 1 - fs/iomap/apply.c | 99 --- fs/iomap/trace.h | 40 - include/linux/iomap.h | 10 - 4 files changed, 150 deletions

[Cluster-devel] [PATCH 20/27] fsdax: switch dax_iomap_rw to use iomap_iter

2021-07-19 Thread Christoph Hellwig
Switch the dax_iomap_rw implementation to use iomap_iter. Signed-off-by: Christoph Hellwig --- fs/dax.c | 49 - 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index 4d63040fd71f56..51da45301350a6 100644

[Cluster-devel] [PATCH 12/27] iomap: switch iomap_zero_range to use iomap_iter

2021-07-19 Thread Christoph Hellwig
Switch iomap_zero_range to use iomap_iter. Signed-off-by: Christoph Hellwig --- fs/iomap/buffered-io.c | 36 ++-- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index 59781c72c278e5..e5832ffb413cb6

[Cluster-devel] [PATCH 19/27] iomap: switch iomap_swapfile_activate to use iomap_iter

2021-07-19 Thread Christoph Hellwig
Switch iomap_swapfile_activate to use iomap_iter. Signed-off-by: Christoph Hellwig --- fs/iomap/swapfile.c | 38 -- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/fs/iomap/swapfile.c b/fs/iomap/swapfile.c index 6250ca6a1f851d..7069606eca85b2

[Cluster-devel] [PATCH 18/27] iomap: switch iomap_seek_data to use iomap_iter

2021-07-19 Thread Christoph Hellwig
Rewrite iomap_seek_data to use iomap_iter. Signed-off-by: Christoph Hellwig --- fs/iomap/seek.c | 42 +- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/fs/iomap/seek.c b/fs/iomap/seek.c index 7d6ed9af925e96..0a758e3851fcb7 100644 --- a/fs

[Cluster-devel] [PATCH 16/27] iomap: switch iomap_bmap to use iomap_iter

2021-07-19 Thread Christoph Hellwig
Rewrite the ->bmap implementation based on iomap_iter. Signed-off-by: Christoph Hellwig --- fs/iomap/fiemap.c | 31 +-- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/fs/iomap/fiemap.c b/fs/iomap/fiemap.c index acad09a8c188df..60daadba16c149 100

[Cluster-devel] [PATCH 15/27] iomap: switch iomap_fiemap to use iomap_iter

2021-07-19 Thread Christoph Hellwig
Rewrite the ->fiemap implementation based on iomap_iter. Signed-off-by: Christoph Hellwig --- fs/iomap/fiemap.c | 70 --- 1 file changed, 29 insertions(+), 41 deletions(-) diff --git a/fs/iomap/fiemap.c b/fs/iomap/fiemap.c index aab070df4a2

[Cluster-devel] [PATCH 14/27] iomap: switch __iomap_dio_rw to use iomap_iter

2021-07-19 Thread Christoph Hellwig
Switch __iomap_dio_rw to use iomap_iter. Signed-off-by: Christoph Hellwig --- fs/btrfs/inode.c | 5 +- fs/iomap/direct-io.c | 162 +- include/linux/iomap.h | 4 +- 3 files changed, 85 insertions(+), 86 deletions(-) diff --git a/fs/btrfs/inode.c

[Cluster-devel] [PATCH 09/27] iomap: switch readahead and readpage to use iomap_iter

2021-07-19 Thread Christoph Hellwig
Switch the page cache read functions to use iomap_iter instead of iomap_apply. Signed-off-by: Christoph Hellwig --- fs/iomap/buffered-io.c | 79 +++--- 1 file changed, 36 insertions(+), 43 deletions(-) diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered

[Cluster-devel] [PATCH 13/27] iomap: switch iomap_page_mkwrite to use iomap_iter

2021-07-19 Thread Christoph Hellwig
Switch iomap_page_mkwrite to use iomap_iter. Signed-off-by: Christoph Hellwig --- fs/iomap/buffered-io.c | 39 +-- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index e5832ffb413cb6

[Cluster-devel] [PATCH 10/27] iomap: switch iomap_file_buffered_write to use iomap_iter

2021-07-19 Thread Christoph Hellwig
Switch iomap_file_buffered_write to use iomap_iter. Signed-off-by: Christoph Hellwig --- fs/iomap/buffered-io.c | 49 +- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index 3b18cafa72bec6

[Cluster-devel] [PATCH 11/27] iomap: switch iomap_file_unshare to use iomap_iter

2021-07-19 Thread Christoph Hellwig
Switch iomap_file_unshare to use iomap_iter. Signed-off-by: Christoph Hellwig --- fs/iomap/buffered-io.c | 35 ++- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index 7195e82d15775e..59781c72c278e5

[Cluster-devel] [PATCH 08/27] iomap: add the new iomap_iter model

2021-07-19 Thread Christoph Hellwig
ed-off-by: Christoph Hellwig --- fs/iomap/Makefile | 1 + fs/iomap/iter.c | 74 +++ fs/iomap/trace.h | 37 +- include/linux/iomap.h | 56 4 files changed, 167 insertions(+), 1 deletion(-) creat

[Cluster-devel] RFC: switch iomap to an iterator model

2021-07-19 Thread Christoph Hellwig
Hi all, this series replies the existing callback-based iomap_apply to an iter based model. The prime aim here is to simply the DAX reflink support, which requires iterating through two inodes, something that is rather painful with the apply model. It also helps to kill an indirect call per

[Cluster-devel] [PATCH 07/27] iomap: mark the iomap argument to iomap_read_page_sync const

2021-07-19 Thread Christoph Hellwig
iomap_read_page_sync never modifies the passed in iomap, so mark it const. Signed-off-by: Christoph Hellwig --- fs/iomap/buffered-io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index e47380259cf7e1..8c26cf7cbd72b0 100644

[Cluster-devel] [PATCH 06/27] iomap: mark the iomap argument to iomap_read_inline_data const

2021-07-19 Thread Christoph Hellwig
iomap_read_inline_data never modifies the passed in iomap, so mark it const. Signed-off-by: Christoph Hellwig --- fs/iomap/buffered-io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index 75310f6fcf8401..e47380259cf7e1

[Cluster-devel] [PATCH 05/27] fsdax: mark the iomap argument to dax_iomap_sector as const

2021-07-19 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- fs/dax.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/dax.c b/fs/dax.c index da41f9363568e0..4d63040fd71f56 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -1005,7 +1005,7 @@ int dax_writeback_mapping_range(struct address_space *mapping

[Cluster-devel] [PATCH 04/27] fs: mark the iomap argument to __block_write_begin_int const

2021-07-19 Thread Christoph Hellwig
__block_write_begin_int never modifies the passed in iomap, so mark it const. Signed-off-by: Christoph Hellwig --- fs/buffer.c | 4 ++-- fs/internal.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index 6290c3afdba488..bd6a9e9fbd64c9 100644

[Cluster-devel] [PATCH 03/27] iomap: mark the iomap argument to iomap_sector const

2021-07-19 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- include/linux/iomap.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/linux/iomap.h b/include/linux/iomap.h index 093519d91cc9cc..f9c36df6a3061b 100644 --- a/include/linux/iomap.h +++ b/include/linux/iomap.h @@ -91,8 +91,7

[Cluster-devel] [PATCH 02/27] iomap: remove the iomap arguments to ->page_{prepare, done}

2021-07-19 Thread Christoph Hellwig
These aren't actually used by the only instance implementing the methods. Signed-off-by: Christoph Hellwig --- fs/gfs2/bmap.c | 5 ++--- fs/iomap/buffered-io.c | 6 +++--- include/linux/iomap.h | 5 ++--- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/fs/gfs2/bmap.c b

[Cluster-devel] [PATCH 01/27] iomap: fix a trivial comment typo in trace.h

2021-07-19 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- fs/iomap/trace.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/iomap/trace.h b/fs/iomap/trace.h index fdc7ae388476f5..e9cd5cc0d6ba40 100644 --- a/fs/iomap/trace.h +++ b/fs/iomap/trace.h @@ -2,7 +2,7 @@ /* * Copyright (c) 2009-2019

Re: [Cluster-devel] [PATCH v3 2/3] iomap: Don't create iomap_page objects for inline files

2021-07-09 Thread Christoph Hellwig
; > To prevent this kind of bug from occurring in the future, make sure the > page doesn't have private data attached in iomap_read_inline_data. > > Signed-off-by: Andreas Gruenbacher Ok, given that you want a quick fix this looks good for now: Reviewed-by: Christoph Hellwig

Re: [Cluster-devel] [PATCH v3 2/3] iomap: Don't create iomap_page objects for inline files

2021-07-09 Thread Christoph Hellwig
On Thu, Jul 08, 2021 at 09:27:37PM -0700, Darrick J. Wong wrote: > I was under the impression that for blksize page always had to have an iop attached. Currently it does. But I've talked since day one of the !bufferhead iomap code that we should eventually lift that.

Re: [Cluster-devel] [PATCH v3 3/3] iomap: Don't create iomap_page objects in iomap_page_mkwrite_actor

2021-07-09 Thread Christoph Hellwig
On Wed, Jul 07, 2021 at 01:55:24PM +0200, Andreas Gruenbacher wrote: > Now that we create those objects in iomap_writepage_map when needed, > there's no need to pre-create them in iomap_page_mkwrite_actor anymore. > > Signed-off-by: Andreas Gruenbacher Looks good, Reviewed-b

Re: [Cluster-devel] [PATCH v2 1/2] iomap: Don't create iomap_page objects for inline files

2021-07-05 Thread Christoph Hellwig
On Mon, Jul 05, 2021 at 08:18:23PM +0200, Andreas Gruenbacher wrote: > In iomap_readpage_actor, don't create iop objects for inline inodes. > Otherwise, iomap_read_inline_data will set PageUptodate without setting > iop->uptodate, and iomap_page_release will eventually complain. > > To prevent

Re: [Cluster-devel] [PATCH v2 2/2] iomap: Permit pages without an iop to enter writeback

2021-07-05 Thread Christoph Hellwig
s > which are entirely within an extent. It also allows for an iop to be > removed from pages in the future (eg page split). > > Co-developed-by: Matthew Wilcox (Oracle) > Signed-off-by: Matthew Wilcox (Oracle) > Signed-off-by: Andreas Gruenbacher Looks good, Reviewed-by: Christoph Hellwig

Re: [Cluster-devel] [PATCH 0/2] iomap: small block problems

2021-07-05 Thread Christoph Hellwig
On Mon, Jul 05, 2021 at 05:51:22PM +0200, Andreas Gruenbacher wrote: > On Wed, Jun 30, 2021 at 2:29 PM Andreas Gruenbacher > wrote: > > Darrick, > > > > will you pick up those two patches and push them to Linus? They both > > seem pretty safe. > > Hello, is there anybody out there? > > I've

Re: [Cluster-devel] [PATCH 0/2] iomap: small block problems

2021-06-28 Thread Christoph Hellwig
On Mon, Jun 28, 2021 at 10:59:55PM +0100, Matthew Wilcox wrote: > > > so permit pages without an iop to enter writeback and create an iop > > > *then*. Would that solve your problem? > > > > It is the right thing to do, especially when combined with a feature > > patch to not bother to create

Re: [Cluster-devel] [PATCH 0/2] iomap: small block problems

2021-06-28 Thread Christoph Hellwig
On Tue, Jun 29, 2021 at 06:29:48AM +0100, Christoph Hellwig wrote: > Hmm. Actually ->page_mkwrite is always is always called on an uptodate > page and we even assert that. I should have remembered the whole page > fault path better. > > So yeah, I think we should take pa

Re: [Cluster-devel] [PATCH 0/2] iomap: small block problems

2021-06-28 Thread Christoph Hellwig
On Mon, Jun 28, 2021 at 06:39:09PM +0100, Matthew Wilcox wrote: > Not hugely happy with either of these options, tbh. I'd rather we apply > a patch akin to this one (plucked from the folio tree), so won't apply: > so permit pages without an iop to enter writeback and create an iop > *then*.

Re: [Cluster-devel] [PATCH RFC PKS/PMEM 24/58] fs/freevxfs: Utilize new kmap_thread()

2020-10-13 Thread Christoph Hellwig
> - kaddr = kmap(pp); > + kaddr = kmap_thread(pp); > memcpy(kaddr, vip->vii_immed.vi_immed + offset, PAGE_SIZE); > - kunmap(pp); > + kunmap_thread(pp); You only Cced me on this particular patch, which means I have absolutely no idea what kmap_thread and kunmap_thread

Re: [Cluster-devel] [PATCH] iomap: Fix direct I/O write consistency check

2020-09-07 Thread Christoph Hellwig
any > dirty pages in that range, the write will fail and a "Page cache > invalidation failure on direct I/O" error will be logged. Looks good, Reviewed-by: Christoph Hellwig

Re: [Cluster-devel] [PATCH 3/3] iomap: fall back to buffered writes for invalidation failures

2020-07-22 Thread Christoph Hellwig
On Tue, Jul 21, 2020 at 01:37:49PM -0700, Darrick J. Wong wrote: > On Tue, Jul 21, 2020 at 08:31:57PM +0200, Christoph Hellwig wrote: > > Failing to invalid the page cache means data in incoherent, which is > > a very bad state for the system. Always fall back to buffered I/O >

[Cluster-devel] [PATCH 3/3] iomap: fall back to buffered writes for invalidation failures

2020-07-21 Thread Christoph Hellwig
Failing to invalid the page cache means data in incoherent, which is a very bad state for the system. Always fall back to buffered I/O through the page cache if we can't invalidate mappings. Signed-off-by: Christoph Hellwig Acked-by: Dave Chinner Reviewed-by: Goldwyn Rodrigues --- fs/ext4

[Cluster-devel] [PATCH 2/3] iomap: Only invalidate page cache pages on direct IO writes

2020-07-21 Thread Christoph Hellwig
invalidating the page cache of a file. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Reviewed-by: Matthew Wilcox (Oracle) Signed-off-by: Christoph Hellwig --- fs/iomap/direct-io.c | 31 +++ 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/fs

[Cluster-devel] iomap write invalidation v2

2020-07-21 Thread Christoph Hellwig
Changes since v1: - use -ENOTBLK for the direct to buffered I/O fallback everywhere - document the choice of -ENOTBLK better - update a comment in XFS

[Cluster-devel] [PATCH 1/3] xfs: use ENOTBLK for direct I/O to buffered I/O fallback

2020-07-21 Thread Christoph Hellwig
This is what the classic fs/direct-io.c implementation and thuse other file systems use. Signed-off-by: Christoph Hellwig --- fs/xfs/xfs_file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index 00db81eac80d6c..a6ef90457abf97

Re: [Cluster-devel] RFC: iomap write invalidation

2020-07-21 Thread Christoph Hellwig
On Tue, Jul 21, 2020 at 04:31:36PM +0100, Matthew Wilcox wrote: > > Umm, no. -ENOTBLK is internal - the file systems will retry using > > buffered I/O and the error shall never escape to userspace (or even the > > VFS for that matter). > > Ah, I made the mistake of believing the comments that I

Re: [Cluster-devel] RFC: iomap write invalidation

2020-07-21 Thread Christoph Hellwig
On Tue, Jul 21, 2020 at 08:27:54AM -0700, Darrick J. Wong wrote: > On Tue, Jul 21, 2020 at 05:16:16PM +0200, Christoph Hellwig wrote: > > On Tue, Jul 21, 2020 at 04:14:37PM +0100, Matthew Wilcox wrote: > > > On Tue, Jul 21, 2020 at 05:06:15PM +0200, Christoph Hellwig wrote: >

Re: [Cluster-devel] RFC: iomap write invalidation

2020-07-21 Thread Christoph Hellwig
On Tue, Jul 21, 2020 at 04:14:37PM +0100, Matthew Wilcox wrote: > On Tue, Jul 21, 2020 at 05:06:15PM +0200, Christoph Hellwig wrote: > > On Tue, Jul 21, 2020 at 04:04:32PM +0100, Matthew Wilcox wrote: > > > I thought you were going to respin this with EREMCHG changed to ENOTBLK?

Re: [Cluster-devel] RFC: iomap write invalidation

2020-07-21 Thread Christoph Hellwig
On Tue, Jul 21, 2020 at 04:04:32PM +0100, Matthew Wilcox wrote: > On Tue, Jul 21, 2020 at 04:53:13PM +0200, Christoph Hellwig wrote: > > On Mon, Jul 20, 2020 at 04:51:25PM -0500, Goldwyn Rodrigues wrote: > > > Hi Christoph, > > > > > > On 9:46 13/07, Chr

Re: [Cluster-devel] RFC: iomap write invalidation

2020-07-21 Thread Christoph Hellwig
On Mon, Jul 20, 2020 at 04:51:25PM -0500, Goldwyn Rodrigues wrote: > Hi Christoph, > > On 9:46 13/07, Christoph Hellwig wrote: > > Hi all, > > > > this series has two parts: the first one picks up Dave's patch to avoid > > invalidation entierly for reads, p

Re: [Cluster-devel] [PATCH 2/2] iomap: fall back to buffered writes for invalidation failures

2020-07-14 Thread Christoph Hellwig
On Mon, Jul 13, 2020 at 08:39:20AM -0700, Darrick J. Wong wrote: > -ENOTBLK is already being used as a "magic" return code that means > "retry this direct write as a buffered write". Shouldn't we use that > instead? > > -EREMCHG was a private hack we put in XFS for the one case where a > direct

Re: [Cluster-devel] [PATCH 2/2] iomap: fall back to buffered writes for invalidation failures

2020-07-14 Thread Christoph Hellwig
On Mon, Jul 13, 2020 at 12:55:09PM +0100, Matthew Wilcox wrote: > On Mon, Jul 13, 2020 at 09:46:33AM +0200, Christoph Hellwig wrote: > > Failing to invalid the page cache means data in incoherent, which is > > a very bad state for the system. Always fall back to buffered I/O >

[Cluster-devel] RFC: iomap write invalidation

2020-07-13 Thread Christoph Hellwig
Hi all, this series has two parts: the first one picks up Dave's patch to avoid invalidation entierly for reads, picked up deep down from the btrfs iomap thread. The second one falls back to buffered writes if invalidation fails instead of leaving a stale cache around. Let me know what you

[Cluster-devel] [PATCH 1/2] iomap: Only invalidate page cache pages on direct IO writes

2020-07-13 Thread Christoph Hellwig
invalidating the page cache of a file. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Reviewed-by: Matthew Wilcox (Oracle) Signed-off-by: Christoph Hellwig --- fs/iomap/direct-io.c | 31 +++ 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/fs

[Cluster-devel] [PATCH 2/2] iomap: fall back to buffered writes for invalidation failures

2020-07-13 Thread Christoph Hellwig
Failing to invalid the page cache means data in incoherent, which is a very bad state for the system. Always fall back to buffered I/O through the page cache if we can't invalidate mappings. Signed-off-by: Christoph Hellwig --- fs/ext4/file.c | 2 ++ fs/gfs2/file.c | 3 ++- fs

Re: [Cluster-devel] always fall back to buffered I/O after invalidation failures, was: Re: [PATCH 2/6] iomap: IOMAP_DIO_RWF_NO_STALE_PAGECACHE return if page invalidation fails

2020-07-10 Thread Christoph Hellwig
This looks sane - slightly updated version below to not bother with the ret and a few tidyups. That being said and to get back to the discussion in this thread: I think it would be saner to give up on direct I/O in case of the invalidation failure. I've cooked up a patch on top of this one (for

Re: [Cluster-devel] always fall back to buffered I/O after invalidation failures, was: Re: [PATCH 2/6] iomap: IOMAP_DIO_RWF_NO_STALE_PAGECACHE return if page invalidation fails

2020-07-08 Thread Christoph Hellwig
On Wed, Jul 08, 2020 at 02:54:37PM +0100, Matthew Wilcox wrote: > Direct I/O isn't deterministic though. If the file isn't shared, then > it works great, but as soon as you get mixed buffered and direct I/O, > everything is already terrible. Direct I/Os perform pagecache lookups > already, but

Re: [Cluster-devel] always fall back to buffered I/O after invalidation failures, was: Re: [PATCH 2/6] iomap: IOMAP_DIO_RWF_NO_STALE_PAGECACHE return if page invalidation fails

2020-07-07 Thread Christoph Hellwig
On Tue, Jul 07, 2020 at 01:57:05PM +0100, Matthew Wilcox wrote: > On Tue, Jul 07, 2020 at 07:43:46AM -0500, Goldwyn Rodrigues wrote: > > On 9:53 01/07, Christoph Hellwig wrote: > > > On Mon, Jun 29, 2020 at 02:23:49PM -0500, Goldwyn Rodrigues wrote: > > >

[Cluster-devel] always fall back to buffered I/O after invalidation failures, was: Re: [PATCH 2/6] iomap: IOMAP_DIO_RWF_NO_STALE_PAGECACHE return if page invalidation fails

2020-07-01 Thread Christoph Hellwig
On Mon, Jun 29, 2020 at 02:23:49PM -0500, Goldwyn Rodrigues wrote: > From: Goldwyn Rodrigues > > For direct I/O, add the flag IOMAP_DIO_RWF_NO_STALE_PAGECACHE to indicate > that if the page invalidation fails, return back control to the > filesystem so it may fallback to buffered mode. > >

[Cluster-devel] [PATCH 3/4] net: add a new bind_add method

2020-05-29 Thread Christoph Hellwig
space. Signed-off-by: Christoph Hellwig --- fs/dlm/lowcomms.c | 9 +++-- include/net/sock.h | 6 +- net/core/sock.c| 8 net/sctp/socket.c | 14 ++ 4 files changed, 30 insertions(+), 7 deletions(-) diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c index

[Cluster-devel] [PATCH 4/4] net: remove kernel_setsockopt

2020-05-29 Thread Christoph Hellwig
No users left. Signed-off-by: Christoph Hellwig --- include/linux/net.h | 2 -- net/socket.c| 31 --- 2 files changed, 33 deletions(-) diff --git a/include/linux/net.h b/include/linux/net.h index 74ef5d7315f70..e10f378194a59 100644 --- a/include/linux/net.h

[Cluster-devel] [PATCH 2/4] sctp: refactor sctp_setsockopt_bindx

2020-05-29 Thread Christoph Hellwig
Split out a sctp_setsockopt_bindx_kernel that takes a kernel pointer to the sockaddr and make sctp_setsockopt_bindx a small wrapper around it. This prepares for adding a new bind_add proto op. Signed-off-by: Christoph Hellwig --- net/sctp/socket.c | 61

[Cluster-devel] [PATCH 1/4] sctp: add sctp_sock_set_nodelay

2020-05-29 Thread Christoph Hellwig
Add a helper to directly set the SCTP_NODELAY sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig --- fs/dlm/lowcomms.c | 10 ++ include/net/sctp/sctp.h | 7 +++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/fs/dlm

Re: [Cluster-devel] [PATCH 4/4] net: remove kernel_setsockopt

2020-05-29 Thread 'Christoph Hellwig'
On Fri, May 29, 2020 at 12:27:12PM +, David Laight wrote: > From: Christoph Hellwig > > Sent: 29 May 2020 13:10 > > > > No users left. > > There is no point even proposing this until all the changes to remove > its use have made it at least as far into 'net-nex

[Cluster-devel] [PATCH 08/28] net: add sock_set_rcvbuf

2020-05-27 Thread Christoph Hellwig
Add a helper to directly set the SO_RCVBUFFORCE sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig --- fs/dlm/lowcomms.c | 7 +- include/net/sock.h | 1 + net/core/sock.c| 59 +- 3 files changed

[Cluster-devel] [PATCH 13/28] tcp: add tcp_sock_set_syncnt

2020-05-27 Thread Christoph Hellwig
Add a helper to directly set the TCP_SYNCNT sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig Acked-by: Sagi Grimberg --- drivers/nvme/host/tcp.c | 9 + include/linux/tcp.h | 1 + net/ipv4/tcp.c | 12 3 files

[Cluster-devel] [PATCH 07/28] net: add sock_set_keepalive

2020-05-27 Thread Christoph Hellwig
Add a helper to directly set the SO_KEEPALIVE sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig --- fs/dlm/lowcomms.c | 6 +- include/net/sock.h| 1 + net/core/sock.c | 10 ++ net/rds/tcp_listen.c | 6 +- net

[Cluster-devel] [PATCH 06/28] net: add sock_enable_timestamps

2020-05-27 Thread Christoph Hellwig
Add a helper to directly enable timestamps instead of setting the SO_TIMESTAMP* sockopts from kernel space and going through a fake uaccess. Signed-off-by: Christoph Hellwig --- include/net/sock.h | 1 + net/core/sock.c | 47 +--- net/rxrpc

[Cluster-devel] [PATCH 03/28] net: add sock_set_priority

2020-05-27 Thread Christoph Hellwig
Add a helper to directly set the SO_PRIORITY sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig Acked-by: Sagi Grimberg --- drivers/nvme/host/tcp.c | 12 ++-- drivers/nvme/target/tcp.c | 18 -- include/net/sock.h

[Cluster-devel] [PATCH 04/28] net: add sock_set_sndtimeo

2020-05-27 Thread Christoph Hellwig
Add a helper to directly set the SO_SNDTIMEO_NEW sockopt from kernel space without going through a fake uaccess. The interface is simplified to only pass the seconds value, as that is the only thing needed at the moment. Signed-off-by: Christoph Hellwig --- fs/dlm/lowcomms.c | 8

[Cluster-devel] remove most callers of kernel_setsockopt v3

2020-05-27 Thread Christoph Hellwig
Hi Dave, this series removes most callers of the kernel_setsockopt functions, and instead switches their users to small functions that implement setting a sockopt directly using a normal kernel function call with type safety and all the other benefits of not having a function call. In some cases

[Cluster-devel] [PATCH 02/28] net: add sock_no_linger

2020-05-27 Thread Christoph Hellwig
Add a helper to directly set the SO_LINGER sockopt from kernel space with onoff set to true and a linger time of 0 without going through a fake uaccess. Signed-off-by: Christoph Hellwig Acked-by: Sagi Grimberg --- drivers/nvme/host/tcp.c | 9 + drivers/nvme/target/tcp.c | 6

[Cluster-devel] [PATCH 16/28] tcp: add tcp_sock_set_keepintvl

2020-05-27 Thread Christoph Hellwig
Add a helper to directly set the TCP_KEEPINTVL sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig --- include/linux/tcp.h | 1 + net/ipv4/tcp.c| 12 net/rds/tcp_listen.c | 4 +--- net/sunrpc/xprtsock.c | 3 +-- 4 files

[Cluster-devel] [PATCH 09/28] net: add sock_set_reuseport

2020-05-27 Thread Christoph Hellwig
Add a helper to directly set the SO_REUSEPORT sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig --- include/net/sock.h| 1 + net/core/sock.c | 8 net/sunrpc/xprtsock.c | 17 + 3 files changed, 10 insertions

[Cluster-devel] [PATCH 14/28] tcp: add tcp_sock_set_user_timeout

2020-05-27 Thread Christoph Hellwig
Add a helper to directly set the TCP_USER_TIMEOUT sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig --- fs/ocfs2/cluster/tcp.c | 22 ++ include/linux/tcp.h| 1 + net/ipv4/tcp.c | 8 net/sunrpc/xprtsock.c

[Cluster-devel] [PATCH 12/28] tcp: add tcp_sock_set_quickack

2020-05-27 Thread Christoph Hellwig
Add a helper to directly set the TCP_QUICKACK sockopt from kernel space without going through a fake uaccess. Cleanup the callers to avoid pointless wrappers now that this is a simple function call. Signed-off-by: Christoph Hellwig --- drivers/block/drbd/drbd_int.h | 7 -- drivers

[Cluster-devel] [PATCH 17/28] tcp: add tcp_sock_set_keepcnt

2020-05-27 Thread Christoph Hellwig
Add a helper to directly set the TCP_KEEPCNT sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig --- include/linux/tcp.h | 1 + net/ipv4/tcp.c| 12 net/rds/tcp.h | 2 +- net/rds/tcp_listen.c | 17

[Cluster-devel] [PATCH 10/28] tcp: add tcp_sock_set_cork

2020-05-27 Thread Christoph Hellwig
Add a helper to directly set the TCP_CORK sockopt from kernel space without going through a fake uaccess. Cleanup the callers to avoid pointless wrappers now that this is a simple function call. Signed-off-by: Christoph Hellwig --- drivers/block/drbd/drbd_int.h | 14 drivers

[Cluster-devel] [PATCH 11/28] tcp: add tcp_sock_set_nodelay

2020-05-27 Thread Christoph Hellwig
Add a helper to directly set the TCP_NODELAY sockopt from kernel space without going through a fake uaccess. Cleanup the callers to avoid pointless wrappers now that this is a simple function call. Signed-off-by: Christoph Hellwig Acked-by: Sagi Grimberg Acked-by: Jason Gunthorpe --- drivers

[Cluster-devel] [PATCH 05/28] net: add sock_bindtoindex

2020-05-27 Thread Christoph Hellwig
Add a helper to directly set the SO_BINDTOIFINDEX sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig --- include/net/sock.h| 1 + net/core/sock.c | 21 +++-- net/ipv4/udp_tunnel.c | 4 +--- net/ipv6

[Cluster-devel] [PATCH 01/28] net: add sock_set_reuseaddr

2020-05-27 Thread Christoph Hellwig
. Signed-off-by: Christoph Hellwig Acked-by: Sagi Grimberg --- drivers/infiniband/sw/siw/siw_cm.c| 18 +- drivers/nvme/target/tcp.c | 8 +--- drivers/target/iscsi/Kconfig | 2 +- drivers/target/iscsi/iscsi_target_login.c | 9 + fs

[Cluster-devel] [PATCH 24/28] ipv6: add ip6_sock_set_recverr

2020-05-27 Thread Christoph Hellwig
Add a helper to directly set the IPV6_RECVERR sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig Reviewed-by: David Howells --- include/net/ipv6.h | 7 +++ net/rxrpc/local_object.c | 10 ++ 2 files changed, 9 insertions(+), 8

[Cluster-devel] [PATCH 25/28] ipv6: add ip6_sock_set_addr_preferences

2020-05-27 Thread Christoph Hellwig
Add a helper to directly set the IPV6_ADD_PREFERENCES sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig --- include/net/ipv6.h | 67 net/ipv6/ipv6_sockglue.c | 59

[Cluster-devel] [PATCH 18/28] ipv4: add ip_sock_set_tos

2020-05-27 Thread Christoph Hellwig
Add a helper to directly set the IP_TOS sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig Acked-by: Sagi Grimberg --- drivers/nvme/host/tcp.c | 14 +++--- drivers/nvme/target/tcp.c | 10 ++ include/net/ip.h | 2 ++ net

[Cluster-devel] [PATCH 26/28] ipv6: add ip6_sock_set_recvpktinfo

2020-05-27 Thread Christoph Hellwig
Add a helper to directly set the IPV6_RECVPKTINFO sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig --- include/net/ipv6.h | 7 +++ net/sunrpc/svcsock.c | 10 ++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/include

[Cluster-devel] [PATCH 20/28] ipv4: add ip_sock_set_recverr

2020-05-27 Thread Christoph Hellwig
Add a helper to directly set the IP_RECVERR sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig Reviewed-by: David Howells --- include/net/ip.h | 1 + net/ipv4/ip_sockglue.c | 8 net/rxrpc/local_object.c | 8 +--- 3 files

[Cluster-devel] [PATCH 21/28] ipv4: add ip_sock_set_mtu_discover

2020-05-27 Thread Christoph Hellwig
Add a helper to directly set the IP_MTU_DISCOVER sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig Reviewed-by: David Howells [rxrpc bits] --- include/net/ip.h | 1 + net/ipv4/ip_sockglue.c | 11 +++ net/rxrpc/local_object.c

[Cluster-devel] [PATCH 28/28] tipc: call tsk_set_importance from tipc_topsrv_create_listener

2020-05-27 Thread Christoph Hellwig
Avoid using kernel_setsockopt for the TIPC_IMPORTANCE option when we can just use the internal helper. The only change needed is to pass a struct sock instead of tipc_sock, which is private to socket.c Signed-off-by: Christoph Hellwig --- net/tipc/socket.c | 18 +- net/tipc

[Cluster-devel] [PATCH 19/28] ipv4: add ip_sock_set_freebind

2020-05-27 Thread Christoph Hellwig
Add a helper to directly set the IP_FREEBIND sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig --- drivers/target/iscsi/iscsi_target_login.c | 13 +++-- include/net/ip.h | 1 + net/ipv4/ip_sockglue.c

[Cluster-devel] [PATCH 15/28] tcp: add tcp_sock_set_keepidle

2020-05-27 Thread Christoph Hellwig
Add a helper to directly set the TCP_KEEP_IDLE sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig --- include/linux/tcp.h | 1 + net/ipv4/tcp.c| 49 ++- net/rds/tcp_listen.c | 5 + net/sunrpc

[Cluster-devel] [PATCH 27/28] rxrpc: add rxrpc_sock_set_min_security_level

2020-05-27 Thread Christoph Hellwig
Add a helper to directly set the RXRPC_MIN_SECURITY_LEVEL sockopt from kernel space without going through a fake uaccess. Thanks to David Howells for the documentation updates. Signed-off-by: Christoph Hellwig Acked-by: David Howells --- Documentation/networking/rxrpc.rst | 13

[Cluster-devel] [PATCH 22/28] ipv4: add ip_sock_set_pktinfo

2020-05-27 Thread Christoph Hellwig
Add a helper to directly set the IP_PKTINFO sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig --- include/net/ip.h | 1 + net/ipv4/ip_sockglue.c | 8 net/sunrpc/svcsock.c | 5 ++--- 3 files changed, 11 insertions(+), 3 deletions

[Cluster-devel] [PATCH 2/2] net: remove kernel_getsockopt

2020-05-27 Thread Christoph Hellwig
No users left. Signed-off-by: Christoph Hellwig --- include/linux/net.h | 2 -- net/socket.c| 34 -- 2 files changed, 36 deletions(-) diff --git a/include/linux/net.h b/include/linux/net.h index 6451425e828f5..74ef5d7315f70 100644 --- a/include/linux

[Cluster-devel] [PATCH 1/2] dlm: use the tcp version of accept_from_sock for sctp as well

2020-05-27 Thread Christoph Hellwig
any reason for the different way of quering the peername, or all the code duplication. Signed-off-by: Christoph Hellwig --- fs/dlm/lowcomms.c | 123 ++ 1 file changed, 3 insertions(+), 120 deletions(-) diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c in

[Cluster-devel] remove kernel_getsockopt

2020-05-27 Thread Christoph Hellwig
Hi dear maintainers, this series reduces scope from the last round and just removes kernel_getsockopt to avoid conflicting with the sctp cleanup series.

Re: [Cluster-devel] remove kernel_setsockopt and kernel_getsockopt v2

2020-05-23 Thread Christoph Hellwig
On Wed, May 20, 2020 at 09:54:36PM +0200, Christoph Hellwig wrote: > Hi Dave, > > this series removes the kernel_setsockopt and kernel_getsockopt > functions, and instead switches their users to small functions that > implement setting (or in one case getting) a sockopt directly u

Re: [Cluster-devel] remove kernel_setsockopt and kernel_getsockopt v2

2020-05-21 Thread 'Christoph Hellwig'
On Thu, May 21, 2020 at 08:01:33AM +, David Laight wrote: > How much does this increase the kernel code by? 44 files changed, 660 insertions(+), 843 deletions(-) > You are also replicating a lot of code making it more > difficult to maintain. No, I specifically don't. > I don't think the

Re: [Cluster-devel] [PATCH 31/33] sctp: add sctp_sock_set_nodelay

2020-05-21 Thread 'Christoph Hellwig'
On Thu, May 21, 2020 at 09:06:19AM +, David Laight wrote: > > > The comment still applies, though. (re the duplication) > > > > Where do you see duplication? > > The whole thing just doesn't scale. > > As soon as you get to the slightly more complex requests > like SCTP_INITMSG (which

Re: [Cluster-devel] [PATCH 32/33] net: add a new bind_add method

2020-05-21 Thread Christoph Hellwig
On Wed, May 20, 2020 at 08:00:25PM -0300, Marcelo Ricardo Leitner wrote: > > + if (err) > > + return err; > > + > > + lock_sock(sk); > > + err = sctp_do_bind(sk, (union sctp_addr *)addr, af->sockaddr_len); > > + if (!err) > > + err = sctp_send_asconf_add_ip(sk, addr,

[Cluster-devel] [PATCH 09/33] net: add sock_set_keepalive

2020-05-20 Thread Christoph Hellwig
Add a helper to directly set the SO_KEEPALIVE sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig --- fs/dlm/lowcomms.c | 6 +- include/net/sock.h| 1 + net/core/sock.c | 10 ++ net/rds/tcp_listen.c | 6 +- net

[Cluster-devel] [PATCH 12/33] tcp: add tcp_sock_set_cork

2020-05-20 Thread Christoph Hellwig
Add a helper to directly set the TCP_CORK sockopt from kernel space without going through a fake uaccess. Cleanup the callers to avoid pointless wrappers now that this is a simple function call. Signed-off-by: Christoph Hellwig --- drivers/block/drbd/drbd_int.h | 14 drivers

[Cluster-devel] [PATCH 05/33] net: add sock_set_priority

2020-05-20 Thread Christoph Hellwig
Add a helper to directly set the SO_PRIORITY sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig Acked-by: Sagi Grimberg --- drivers/nvme/host/tcp.c | 12 ++-- drivers/nvme/target/tcp.c | 18 -- include/net/sock.h

[Cluster-devel] [PATCH 07/33] net: add sock_bindtoindex

2020-05-20 Thread Christoph Hellwig
Add a helper to directly set the SO_BINDTOIFINDEX sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig --- include/net/sock.h| 1 + net/core/sock.c | 21 +++-- net/ipv4/udp_tunnel.c | 4 +--- net/ipv6

[Cluster-devel] [PATCH 08/33] net: add sock_enable_timestamps

2020-05-20 Thread Christoph Hellwig
Add a helper to directly enable timestamps instead of setting the SO_TIMESTAMP* sockopts from kernel space and going through a fake uaccess. Signed-off-by: Christoph Hellwig --- include/net/sock.h | 1 + net/core/sock.c | 47 +--- net/rxrpc

[Cluster-devel] [PATCH 04/33] net: add sock_no_linger

2020-05-20 Thread Christoph Hellwig
Add a helper to directly set the SO_LINGER sockopt from kernel space with onoff set to true and a linger time of 0 without going through a fake uaccess. Signed-off-by: Christoph Hellwig Acked-by: Sagi Grimberg --- drivers/nvme/host/tcp.c | 9 + drivers/nvme/target/tcp.c | 6

[Cluster-devel] [PATCH 10/33] net: add sock_set_rcvbuf

2020-05-20 Thread Christoph Hellwig
Add a helper to directly set the SO_RCVBUFFORCE sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig --- fs/dlm/lowcomms.c | 7 +- include/net/sock.h | 1 + net/core/sock.c| 59 +- 3 files changed

[Cluster-devel] [PATCH 06/33] net: add sock_set_sndtimeo

2020-05-20 Thread Christoph Hellwig
Add a helper to directly set the SO_SNDTIMEO_NEW sockopt from kernel space without going through a fake uaccess. The interface is simplified to only pass the seconds value, as that is the only thing needed at the moment. Signed-off-by: Christoph Hellwig --- fs/dlm/lowcomms.c | 8

<    1   2   3   4   5   6   7   8   9   10   >