]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
rds: make use of iov_iter_revert()
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 13 Apr 2017 03:09:32 +0000 (23:09 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 21 Apr 2017 17:57:11 +0000 (13:57 -0400)
net/rds/recv.c

index 8b7e7b7f2c2dbebee31dd7626540b797f1fa353f..c70c32cb05f5ff3a0f91dd0627b9525413c37318 100644 (file)
@@ -594,7 +594,6 @@ int rds_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
                goto out;
 
        while (1) {
-               struct iov_iter save;
                /* If there are pending notifications, do those - and nothing else */
                if (!list_empty(&rs->rs_notify_queue)) {
                        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,
                         &inc->i_conn->c_faddr,
                         ntohs(inc->i_hdr.h_sport));
-               save = msg->msg_iter;
                ret = inc->i_conn->c_trans->inc_copy_to_user(inc, &msg->msg_iter);
                if (ret < 0)
                        break;
@@ -644,7 +642,7 @@ int rds_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
                        rds_inc_put(inc);
                        inc = NULL;
                        rds_stats_inc(s_recv_deliver_raced);
-                       msg->msg_iter = save;
+                       iov_iter_revert(&msg->msg_iter, ret);
                        continue;
                }