[Drbd-dev] [PATCH 6/8] drbd: get rid of set_fs() usage

Michael D Labriola michael.d.labriola at gmail.com
Sun Dec 13 06:58:57 CET 2020


5.10 is getting rid of set_fs().  When I went looking through git commits
to figure out how to properly protect sendpage, what I found was this
commit from 4.13:

    10428957 drbd: ->sendpage() never needed set_fs()

Signed-off-by: Michael D Labriola <michael.d.labriola at gmail.com>
---
 drbd/drbd_transport_tcp.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drbd/drbd_transport_tcp.c b/drbd/drbd_transport_tcp.c
index 3b1d4273..4e076460 100644
--- a/drbd/drbd_transport_tcp.c
+++ b/drbd/drbd_transport_tcp.c
@@ -1138,7 +1138,6 @@ static int dtt_send_page(struct drbd_transport *transport, enum drbd_stream stre
 	struct drbd_tcp_transport *tcp_transport =
 		container_of(transport, struct drbd_tcp_transport, transport);
 	struct socket *socket = tcp_transport->stream[stream];
-	mm_segment_t oldfs = get_fs();
 	int len = size;
 	int err = -EIO;
 
@@ -1147,7 +1146,6 @@ static int dtt_send_page(struct drbd_transport *transport, enum drbd_stream stre
 
 	msg_flags |= MSG_NOSIGNAL;
 	dtt_update_congested(tcp_transport);
-	set_fs(KERNEL_DS);
 	do {
 		int sent;
 
@@ -1173,7 +1171,6 @@ static int dtt_send_page(struct drbd_transport *transport, enum drbd_stream stre
 		 * and add that to the while() condition below.
 		 */
 	} while (len > 0 /* THINK && peer_device->repl_state[NOW] >= L_ESTABLISHED */);
-	set_fs(oldfs);
 	clear_bit(NET_CONGESTED, &tcp_transport->transport.flags);
 
 	if (len == 0)
-- 
2.17.1



More information about the drbd-dev mailing list