[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

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

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

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

[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

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

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

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

2020-05-27 Thread Christoph Hellwig
Add a helper to directly set the SO_REUSEADDR sockopt from kernel space without going through a fake uaccess. For this the iscsi target now has to formally depend on inet to avoid a mostly theoretical compile failure. For actual operation it already did depend on having ipv4 or ipv6 support.

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

[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

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

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

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

Re: [Cluster-devel] remove kernel_getsockopt

2020-05-27 Thread David Miller
From: Christoph Hellwig Date: Wed, 27 May 2020 20:22:27 +0200 > this series reduces scope from the last round and just removes > kernel_getsockopt to avoid conflicting with the sctp cleanup series. Series applied to net-next, thanks.

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

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

2020-05-27 Thread Christoph Hellwig
The only difference between a few missing fixes applied to the SCTP one is that TCP uses ->getpeername to get the remote address, while SCTP uses kernel_getsockopt(.. SCTP_PRIMARY_ADDR). But given that getpeername is defined to return the primary address for sctp, there doesn't seem to be any

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

[Cluster-devel] [PATCH] mkfs.gfs2: Don't use i/o limits hints <4K for block size

2020-05-27 Thread Andrew Price
Some devices report an optimal_io_size less than 4K. Currently mkfs.gfs2 uses the non-zero value to choose the block size, which is almost certainly a bad choice when it's less than 4K. Update choose_blocksize() to avoid using device topology hints for the block size choice when they're less than

Re: [Cluster-devel] [PATCH] mkfs.gfs2: Don't use optimal_io_size when equal to minimum

2020-05-27 Thread Andrew Price
On 27/05/2020 11:07, Steven Whitehouse wrote: By default, I can't see any reason why we'd want a block sizes less than 4k. We might want to allow someone to do that for special cases, but generally the lower block sizes cause issue with larger file sizes, due to the increased height of the

Re: [Cluster-devel] [PATCH] mkfs.gfs2: Don't use optimal_io_size when equal to minimum

2020-05-27 Thread Steven Whitehouse
Hi, On 27/05/2020 11:02, Andrew Price wrote: On 27/05/2020 09:53, Steven Whitehouse wrote: Hi, On 27/05/2020 09:29, Andrew Price wrote: Some devices report an optimal_io_size of 512 instead of 0 when it's not larger than the minimum_io_size. Currently mkfs.gfs2 uses the non-zero value to

Re: [Cluster-devel] [PATCH] mkfs.gfs2: Don't use optimal_io_size when equal to minimum

2020-05-27 Thread Andrew Price
On 27/05/2020 09:53, Steven Whitehouse wrote: Hi, On 27/05/2020 09:29, Andrew Price wrote: Some devices report an optimal_io_size of 512 instead of 0 when it's not larger than the minimum_io_size. Currently mkfs.gfs2 uses the non-zero value to choose the block size, which is almost certainly

Re: [Cluster-devel] [PATCH] mkfs.gfs2: Don't use optimal_io_size when equal to minimum

2020-05-27 Thread Steven Whitehouse
Hi, On 27/05/2020 09:29, Andrew Price wrote: Some devices report an optimal_io_size of 512 instead of 0 when it's not larger than the minimum_io_size. Currently mkfs.gfs2 uses the non-zero value to choose the block size, which is almost certainly not what we want when it's 512. Update the

[Cluster-devel] [PATCH] mkfs.gfs2: Don't use optimal_io_size when equal to minimum

2020-05-27 Thread Andrew Price
Some devices report an optimal_io_size of 512 instead of 0 when it's not larger than the minimum_io_size. Currently mkfs.gfs2 uses the non-zero value to choose the block size, which is almost certainly not what we want when it's 512. Update the suitability check for optimal_io_size to avoid using