Skip to content

Commit b1fd8bd

Browse files
committed
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
2 parents 2c26b68 + 6f8b478 commit b1fd8bd

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

fs/dlm/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ menuconfig DLM
33
tristate "Distributed Lock Manager (DLM)"
44
depends on INET
55
depends on SYSFS && CONFIGFS_FS && (IPV6 || IPV6=n)
6-
select IP_SCTP
76
help
87
A general purpose distributed lock manager for kernel or userspace
98
applications.

fs/dlm/config.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,9 @@ static int dlm_check_protocol_and_dlm_running(unsigned int x)
197197
break;
198198
case 1:
199199
/* SCTP */
200+
if (!IS_ENABLED(CONFIG_IP_SCTP))
201+
return -EOPNOTSUPP;
202+
200203
break;
201204
default:
202205
return -EINVAL;

fs/dlm/lowcomms.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ struct dlm_proto_ops {
160160
bool try_new_addr;
161161
const char *name;
162162
int proto;
163+
int how;
163164

164165
void (*sockopts)(struct socket *sock);
165166
int (*bind)(struct socket *sock);
@@ -533,7 +534,7 @@ static void lowcomms_state_change(struct sock *sk)
533534
/* SCTP layer is not calling sk_data_ready when the connection
534535
* is done, so we catch the signal through here.
535536
*/
536-
if (sk->sk_shutdown == RCV_SHUTDOWN)
537+
if (sk->sk_shutdown & RCV_SHUTDOWN)
537538
lowcomms_data_ready(sk);
538539
}
539540

@@ -810,7 +811,7 @@ static void shutdown_connection(struct connection *con, bool and_other)
810811
return;
811812
}
812813

813-
ret = kernel_sock_shutdown(con->sock, SHUT_WR);
814+
ret = kernel_sock_shutdown(con->sock, dlm_proto_ops->how);
814815
up_read(&con->sock_lock);
815816
if (ret) {
816817
log_print("Connection %p failed to shutdown: %d will force close",
@@ -1858,6 +1859,7 @@ static int dlm_tcp_listen_bind(struct socket *sock)
18581859
static const struct dlm_proto_ops dlm_tcp_ops = {
18591860
.name = "TCP",
18601861
.proto = IPPROTO_TCP,
1862+
.how = SHUT_WR,
18611863
.sockopts = dlm_tcp_sockopts,
18621864
.bind = dlm_tcp_bind,
18631865
.listen_validate = dlm_tcp_listen_validate,
@@ -1896,6 +1898,7 @@ static void dlm_sctp_sockopts(struct socket *sock)
18961898
static const struct dlm_proto_ops dlm_sctp_ops = {
18971899
.name = "SCTP",
18981900
.proto = IPPROTO_SCTP,
1901+
.how = SHUT_RDWR,
18991902
.try_new_addr = true,
19001903
.sockopts = dlm_sctp_sockopts,
19011904
.bind = dlm_sctp_bind,

0 commit comments

Comments
 (0)