Commit 1ba95105 authored by Chuck Lever's avatar Chuck Lever Committed by Linus Torvalds

[PATCH] knfsd: SUNRPC: Don't set msg_name and msg_namelen when calling sock_recvmsg

Clean-up: msg_name and msg_namelen are not used by sock_recvmsg, so don't
bother to set them in svc_recvfrom.
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarNeil Brown <neilb@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 067d7817
...@@ -569,21 +569,13 @@ static int ...@@ -569,21 +569,13 @@ static int
svc_recvfrom(struct svc_rqst *rqstp, struct kvec *iov, int nr, int buflen) svc_recvfrom(struct svc_rqst *rqstp, struct kvec *iov, int nr, int buflen)
{ {
struct svc_sock *svsk = rqstp->rq_sock; struct svc_sock *svsk = rqstp->rq_sock;
struct msghdr msg; struct msghdr msg = {
struct socket *sock; .msg_flags = MSG_DONTWAIT,
};
int len; int len;
rqstp->rq_addrlen = sizeof(rqstp->rq_addr); len = kernel_recvmsg(svsk->sk_sock, &msg, iov, nr, buflen,
sock = svsk->sk_sock; msg.msg_flags);
msg.msg_name = &rqstp->rq_addr;
msg.msg_namelen = sizeof(rqstp->rq_addr);
msg.msg_control = NULL;
msg.msg_controllen = 0;
msg.msg_flags = MSG_DONTWAIT;
len = kernel_recvmsg(sock, &msg, iov, nr, buflen, MSG_DONTWAIT);
/* sock_recvmsg doesn't fill in the name/namelen, so we must.. /* sock_recvmsg doesn't fill in the name/namelen, so we must..
*/ */
...@@ -591,7 +583,7 @@ svc_recvfrom(struct svc_rqst *rqstp, struct kvec *iov, int nr, int buflen) ...@@ -591,7 +583,7 @@ svc_recvfrom(struct svc_rqst *rqstp, struct kvec *iov, int nr, int buflen)
rqstp->rq_addrlen = svsk->sk_remotelen; rqstp->rq_addrlen = svsk->sk_remotelen;
dprintk("svc: socket %p recvfrom(%p, %Zu) = %d\n", dprintk("svc: socket %p recvfrom(%p, %Zu) = %d\n",
rqstp->rq_sock, iov[0].iov_base, iov[0].iov_len, len); svsk, iov[0].iov_base, iov[0].iov_len, len);
return len; return len;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment