1
0
Fork 0

rds: make use of iov_iter_revert()

hifive-unleashed-5.1
Al Viro 2017-04-12 23:09:32 -04:00
parent 85128b2be6
commit dc88e3b4c8
1 changed files with 1 additions and 3 deletions

View File

@ -594,7 +594,6 @@ int rds_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
goto out; goto out;
while (1) { while (1) {
struct iov_iter save;
/* If there are pending notifications, do those - and nothing else */ /* If there are pending notifications, do those - and nothing else */
if (!list_empty(&rs->rs_notify_queue)) { if (!list_empty(&rs->rs_notify_queue)) {
ret = rds_notify_queue_get(rs, msg); ret = rds_notify_queue_get(rs, msg);
@ -630,7 +629,6 @@ int rds_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
rdsdebug("copying inc %p from %pI4:%u to user\n", inc, rdsdebug("copying inc %p from %pI4:%u to user\n", inc,
&inc->i_conn->c_faddr, &inc->i_conn->c_faddr,
ntohs(inc->i_hdr.h_sport)); ntohs(inc->i_hdr.h_sport));
save = msg->msg_iter;
ret = inc->i_conn->c_trans->inc_copy_to_user(inc, &msg->msg_iter); ret = inc->i_conn->c_trans->inc_copy_to_user(inc, &msg->msg_iter);
if (ret < 0) if (ret < 0)
break; break;
@ -644,7 +642,7 @@ int rds_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
rds_inc_put(inc); rds_inc_put(inc);
inc = NULL; inc = NULL;
rds_stats_inc(s_recv_deliver_raced); rds_stats_inc(s_recv_deliver_raced);
msg->msg_iter = save; iov_iter_revert(&msg->msg_iter, ret);
continue; continue;
} }