Skip to contentSkip to conversation

net/smc: fix clc problem

PATCH Applied Ursula Braun 2 participants 3 messages Mar 27, 2018

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover net/smc: fix clc problem

Dave,

the conversion from kernel_recvmsg() to sock_recvmsg() introduced a problem for SMC. This patch fixes it.

Thanks, Ursula

Ursula Braun (1):
net/smc: use announced length in sock_recvmsg()

 net/smc/smc_clc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.13.5
#1 lore raw

PATCH 1/1 net/smc: use announced length in sock_recvmsg()

Not every CLC proposal message needs the maximum buffer length. Due to the MSG_WAITALL flag, it is important to use the peeked real length when receiving the message.

Fixes d63d271ce2b5ce ("smc: switch to sock_recvmsg()")
---
 net/smc/smc_clc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/smc/smc_clc.c +1 -1
index 8ac51583a063..15c213250606 100644
@@ -133,7 +133,7 @@ int smc_clc_wait_msg(struct smc_sock *smc, void *buf, int buflen,
 
 	/* receive the complete CLC message */
 	memset(&msg, 0, sizeof(struct msghdr));
-	iov_iter_kvec(&msg.msg_iter, READ | ITER_KVEC, &vec, 1, buflen);
+	iov_iter_kvec(&msg.msg_iter, READ | ITER_KVEC, &vec, 1, datlen);
 	krflags = MSG_WAITALL;
 	smc->clcsock->sk->sk_rcvtimeo = CLC_WAIT_TIME;
 	len = sock_recvmsg(smc->clcsock, &msg, krflags);
Signature · 1 line
2.13.5
maintainer Applied
#2 lore raw

Re: [PATCH net 1/1] net/smc: use announced length in sock_recvmsg()

From: Ursula Braun <[email protected]>
Date: Tue, 27 Mar 2018 10:43:50 +0200

Quoted 6 lines

Not every CLC proposal message needs the maximum buffer length. Due to the MSG_WAITALL flag, it is important to use the peeked real length when receiving the message.

Fixes d63d271ce2b5ce ("smc: switch to sock_recvmsg()")

Applied, thank you.