Commit cd22c8c9 authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] Only set dest addr in NFS/udp reply, not NFS/tcp.

We don't need to send an empty message to
set up remote address when sending tcp reply, so
we don't.  Also, as the data is empty, we don't
need to set_fs.
parent e063af97
...@@ -324,10 +324,8 @@ svc_wake_up(struct svc_serv *serv) ...@@ -324,10 +324,8 @@ svc_wake_up(struct svc_serv *serv)
static int static int
svc_sendto(struct svc_rqst *rqstp, struct xdr_buf *xdr) svc_sendto(struct svc_rqst *rqstp, struct xdr_buf *xdr)
{ {
mm_segment_t oldfs;
struct svc_sock *svsk = rqstp->rq_sock; struct svc_sock *svsk = rqstp->rq_sock;
struct socket *sock = svsk->sk_sock; struct socket *sock = svsk->sk_sock;
struct msghdr msg;
int slen; int slen;
int len = 0; int len = 0;
int result; int result;
...@@ -339,23 +337,23 @@ svc_sendto(struct svc_rqst *rqstp, struct xdr_buf *xdr) ...@@ -339,23 +337,23 @@ svc_sendto(struct svc_rqst *rqstp, struct xdr_buf *xdr)
slen = xdr->len; slen = xdr->len;
msg.msg_name = &rqstp->rq_addr;
msg.msg_namelen = sizeof(rqstp->rq_addr);
msg.msg_iov = NULL;
msg.msg_iovlen = 0;
msg.msg_control = NULL;
msg.msg_controllen = 0;
msg.msg_flags = MSG_MORE;
/* Grab svsk->sk_sem to serialize outgoing data. */ /* Grab svsk->sk_sem to serialize outgoing data. */
down(&svsk->sk_sem); down(&svsk->sk_sem);
/* set the destination */ if (rqstp->rq_prot == IPPROTO_UDP) {
oldfs = get_fs(); set_fs(KERNEL_DS); /* set the destination */
len = sock_sendmsg(sock, &msg, 0); struct msghdr msg;
set_fs(oldfs); msg.msg_name = &rqstp->rq_addr;
if (len < 0) msg.msg_namelen = sizeof(rqstp->rq_addr);
goto out; msg.msg_iov = NULL;
msg.msg_iovlen = 0;
msg.msg_control = NULL;
msg.msg_controllen = 0;
msg.msg_flags = MSG_MORE;
if (sock_sendmsg(sock, &msg, 0) < 0)
goto out;
}
/* send head */ /* send head */
if (slen == xdr->head[0].iov_len) if (slen == xdr->head[0].iov_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