Subject: linux-next: manual merge of the net-next tree with the vfs tree

From: Stephen Rothwell <[email-masked]>
Date: Mon, 30 Mar 2015 14:24:36 +1100

Hi all,

Today's linux-next merge of the net-next tree got a conflict in
net/socket.c between commit 774157aa4897 ("net: switch importing msghdr
from userland to {compat_,}import_iovec()") from the vfs tree and
commit 0345f93138b2 ("net: socket: add support for async operations")
from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwell                    [email-masked]

diff --cc net/socket.c
index abc721654ab5,073809f4125f..000000000000
--- a/net/socket.c
+++ b/net/socket.c
@@@ -841,11 -808,10 +794,10 @@@ static ssize_t sock_read_iter(struct ki
  	if (iocb->ki_pos != 0)
  		return -ESPIPE;
  
 -	if (iocb->ki_nbytes == 0)	/* Match SYS5 behaviour */
 +	if (!iov_iter_count(to))	/* Match SYS5 behaviour */
  		return 0;
  
- 	res = __sock_recvmsg(iocb, sock, &msg,
- 			     iov_iter_count(to), msg.msg_flags);
 -	res = sock_recvmsg(sock, &msg, iocb->ki_nbytes, msg.msg_flags);
++	res = sock_recvmsg(sock, &msg, iov_iter_count(to), msg.msg_flags);
  	*to = msg.msg_iter;
  	return res;
  }
@@@ -866,7 -833,7 +819,7 @@@ static ssize_t sock_write_iter(struct k
  	if (sock->type == SOCK_SEQPACKET)
  		msg.msg_flags |= MSG_EOR;
  
- 	res = __sock_sendmsg(iocb, sock, &msg, iov_iter_count(from));
 -	res = sock_sendmsg(sock, &msg, iocb->ki_nbytes);
++	res = sock_sendmsg(sock, &msg, iov_iter_count(from));
  	*from = msg.msg_iter;
  	return res;
  }
@@@ -1921,8 -1896,15 +1874,10 @@@ static int copy_msghdr_from_user(struc
  	if (nr_segs > UIO_MAXIOV)
  		return -EMSGSIZE;
  
+ 	kmsg->msg_iocb = NULL;
+ 
 -	err = rw_copy_check_uvector(save_addr ? READ : WRITE,
 -				    uiov, nr_segs,
 -				    UIO_FASTIOV, *iov, iov);
 -	if (err >= 0)
 -		iov_iter_init(&kmsg->msg_iter, save_addr ? READ : WRITE,
 -			      *iov, nr_segs, err);
 -	return err;
 +	return import_iovec(save_addr ? READ : WRITE, uiov, nr_segs,
 +			    UIO_FASTIOV, iov, &kmsg->msg_iter);
  }
  
  static int ___sys_sendmsg(struct socket *sock, struct user_msghdr __user *msg,