Commit b1fd8bd0 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
parents 2c26b68c 6f8b4788
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -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.
+3 −0
Original line number Diff line number Diff line
@@ -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;
+5 −2
Original line number Diff line number Diff line
@@ -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,