c42d1c5129
bsc#1179708, compat to kernel v5.10. version 9.0.26 OBS-URL: https://build.opensuse.org/request/show/854412 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/drbd?expand=0&rev=124
50 lines
1.8 KiB
Diff
50 lines
1.8 KiB
Diff
3d13f313c, Add force_uaccess_{begin,end} helpers for get_fs/set_fs
|
|
|
|
diff -Naur drbd-9.0.26~0+git.9114a038.orig/drbd/drbd-kernel-compat/tests/have_force_uaccess_begin.c drbd-9.0.26~0+git.9114a038/drbd/drbd-kernel-compat/tests/have_force_uaccess_begin.c
|
|
--- drbd-9.0.26~0+git.9114a038.orig/drbd/drbd-kernel-compat/tests/have_force_uaccess_begin.c 1970-01-01 08:00:00.000000000 +0800
|
|
+++ drbd-9.0.26~0+git.9114a038/drbd/drbd-kernel-compat/tests/have_force_uaccess_begin.c 2020-12-09 19:36:17.554021899 +0800
|
|
@@ -0,0 +1,7 @@
|
|
+/* 3d13f313c Add force_uaccess_{begin,end} helpers for get_fs/set_fs */
|
|
+#include <linux/uaccess.h>
|
|
+
|
|
+void dummy(void)
|
|
+{
|
|
+ force_uaccess_begin();
|
|
+}
|
|
diff -Naur drbd-9.0.26~0+git.9114a038.orig/drbd/drbd_transport_tcp.c drbd-9.0.26~0+git.9114a038/drbd/drbd_transport_tcp.c
|
|
--- drbd-9.0.26~0+git.9114a038.orig/drbd/drbd_transport_tcp.c 2020-12-09 19:35:57.493892623 +0800
|
|
+++ drbd-9.0.26~0+git.9114a038/drbd/drbd_transport_tcp.c 2020-12-09 19:40:44.863689731 +0800
|
|
@@ -1145,7 +1145,12 @@
|
|
struct drbd_tcp_transport *tcp_transport =
|
|
container_of(transport, struct drbd_tcp_transport, transport);
|
|
struct socket *socket = tcp_transport->stream[stream];
|
|
+#ifdef COMPAT_HAVE_FORCE_UACCESS_BEGIN
|
|
+ mm_segment_t oldfs = force_uaccess_begin();
|
|
+#else
|
|
mm_segment_t oldfs = get_fs();
|
|
+ set_fs(KERNEL_DS);
|
|
+#endif
|
|
int len = size;
|
|
int err = -EIO;
|
|
|
|
@@ -1154,7 +1159,6 @@
|
|
|
|
msg_flags |= MSG_NOSIGNAL;
|
|
dtt_update_congested(tcp_transport);
|
|
- set_fs(KERNEL_DS);
|
|
do {
|
|
int sent;
|
|
|
|
@@ -1180,7 +1184,11 @@
|
|
* and add that to the while() condition below.
|
|
*/
|
|
} while (len > 0 /* THINK && peer_device->repl_state[NOW] >= L_ESTABLISHED */);
|
|
+#ifdef COMPAT_HAVE_FORCE_UACCESS_BEGIN
|
|
+ force_uaccess_end(oldfs);
|
|
+#else
|
|
set_fs(oldfs);
|
|
+#endif
|
|
clear_bit(NET_CONGESTED, &tcp_transport->transport.flags);
|
|
|
|
if (len == 0)
|