dlm for 6.16

This set fixes delays when shutting down SCTP connections, and updates
 dlm Kconfig for SCTP.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEcGkeEvkvjdvlR90nOBtzx/yAaaoFAmg14oIACgkQOBtzx/yA
 aaqCohAAtDIFXcMI3ydJ6K0FGf9QMiZEykFgCkwrUHpmisDOzbY3wqpyz6/auoCG
 u4yCE1yj7JDePiO+JzspUzYtDDNYVk5/FDrF7H4tpa2YIZ1E53c6pqT2SFu41a46
 FDovAG9PIpVulOOG3X/A4XDfqJoTG3ole8i+VBM4LOOAjesvrEBKunV0ni77PC9/
 bwzeQWgxg4rBx8AWVwn9AhzjNx8siWfDmvEkJAC/8O2PukTPHmcoiwSKlR3S5rfI
 gYkQmwETmgg1BWAYrn0SgBGjVPztuZzgV3TLQ0OeDhlROZlyBKqoS1BDzH8OoeM0
 DAydowN/A//zdwBA2thY0GVRdHA0jMxdWok3sXSt/y0PUNrJVwDCLf+d4QJixFPS
 aD8Vq420pchi23KXjxWfWIJGIa3DgaJl65daqFeQUbBEoLdsNPxi3dtY4/GuZvPu
 IHlKodQW8QRI6UIJF46Y8/A04qewEaP2fmhd2gMPAo6uZxbgnabmi2AUlbb3UGTB
 0bafN/hcsHfyh0byTeK8qljOR+v3nT0Zkxk3eVdLZh0kJaR/r/e9C5MsLZEdKs5f
 InQqwCxjPKViJ8SSuOWJE/f/+fnwIPK9ge/XF/u90Y40X5tMWIYgzvJSBuwhjBDG
 G1C/rzgD+CFKbNVkwicAY3/LbF6wr0CGziY1B8Wfk1TW6pvngAs=
 =pFlu
 -----END PGP SIGNATURE-----

Merge tag 'dlm-6.16' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm

Pull dlm updates from David Teigland:
 "This fixes delays when shutting down SCTP connections, and updates dlm
  Kconfig for SCTP"

* tag 'dlm-6.16' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm:
  dlm: drop SCTP Kconfig dependency
  dlm: reject SCTP configuration if not enabled
  dlm: use SHUT_RDWR for SCTP shutdown
  dlm: mask sk_shutdown value
This commit is contained in:
Linus Torvalds 2025-05-28 12:40:39 -07:00
commit b1fd8bd0cc
3 changed files with 8 additions and 3 deletions

View File

@ -3,7 +3,6 @@ menuconfig DLM
tristate "Distributed Lock Manager (DLM)"
depends on INET
depends on SYSFS && CONFIGFS_FS && (IPV6 || IPV6=n)
select IP_SCTP
help
A general purpose distributed lock manager for kernel or userspace
applications.

View File

@ -197,6 +197,9 @@ static int dlm_check_protocol_and_dlm_running(unsigned int x)
break;
case 1:
/* SCTP */
if (!IS_ENABLED(CONFIG_IP_SCTP))
return -EOPNOTSUPP;
break;
default:
return -EINVAL;

View File

@ -160,6 +160,7 @@ struct dlm_proto_ops {
bool try_new_addr;
const char *name;
int proto;
int how;
void (*sockopts)(struct socket *sock);
int (*bind)(struct socket *sock);
@ -533,7 +534,7 @@ static void lowcomms_state_change(struct sock *sk)
/* SCTP layer is not calling sk_data_ready when the connection
* is done, so we catch the signal through here.
*/
if (sk->sk_shutdown == RCV_SHUTDOWN)
if (sk->sk_shutdown & RCV_SHUTDOWN)
lowcomms_data_ready(sk);
}
@ -810,7 +811,7 @@ static void shutdown_connection(struct connection *con, bool and_other)
return;
}
ret = kernel_sock_shutdown(con->sock, SHUT_WR);
ret = kernel_sock_shutdown(con->sock, dlm_proto_ops->how);
up_read(&con->sock_lock);
if (ret) {
log_print("Connection %p failed to shutdown: %d will force close",
@ -1858,6 +1859,7 @@ static int dlm_tcp_listen_bind(struct socket *sock)
static const struct dlm_proto_ops dlm_tcp_ops = {
.name = "TCP",
.proto = IPPROTO_TCP,
.how = SHUT_WR,
.sockopts = dlm_tcp_sockopts,
.bind = dlm_tcp_bind,
.listen_validate = dlm_tcp_listen_validate,
@ -1896,6 +1898,7 @@ static void dlm_sctp_sockopts(struct socket *sock)
static const struct dlm_proto_ops dlm_sctp_ops = {
.name = "SCTP",
.proto = IPPROTO_SCTP,
.how = SHUT_RDWR,
.try_new_addr = true,
.sockopts = dlm_sctp_sockopts,
.bind = dlm_sctp_bind,