]> git.baikalelectronics.ru Git - kernel.git/commitdiff
fix "direction" argument of iov_iter_kvec()
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 15 Sep 2022 23:16:56 +0000 (19:16 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Feb 2023 10:28:04 +0000 (11:28 +0100)
[ Upstream commit fc02f33787d8dd227b54f263eba983d5b249c032 ]

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Stable-dep-of: 6dd88fd59da8 ("vhost-scsi: unbreak any layout for response")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/xen/pvcalls-back.c

index d6f945fd414746cb0af8f7e0a7f12a230589ccbc..21b9c850a382f31932264049de0ae36f59d63dc7 100644 (file)
@@ -129,13 +129,13 @@ static bool pvcalls_conn_back_read(void *opaque)
        if (masked_prod < masked_cons) {
                vec[0].iov_base = data->in + masked_prod;
                vec[0].iov_len = wanted;
-               iov_iter_kvec(&msg.msg_iter, WRITE, vec, 1, wanted);
+               iov_iter_kvec(&msg.msg_iter, READ, vec, 1, wanted);
        } else {
                vec[0].iov_base = data->in + masked_prod;
                vec[0].iov_len = array_size - masked_prod;
                vec[1].iov_base = data->in;
                vec[1].iov_len = wanted - vec[0].iov_len;
-               iov_iter_kvec(&msg.msg_iter, WRITE, vec, 2, wanted);
+               iov_iter_kvec(&msg.msg_iter, READ, vec, 2, wanted);
        }
 
        atomic_set(&map->read, 0);
@@ -188,13 +188,13 @@ static bool pvcalls_conn_back_write(struct sock_mapping *map)
        if (pvcalls_mask(prod, array_size) > pvcalls_mask(cons, array_size)) {
                vec[0].iov_base = data->out + pvcalls_mask(cons, array_size);
                vec[0].iov_len = size;
-               iov_iter_kvec(&msg.msg_iter, READ, vec, 1, size);
+               iov_iter_kvec(&msg.msg_iter, WRITE, vec, 1, size);
        } else {
                vec[0].iov_base = data->out + pvcalls_mask(cons, array_size);
                vec[0].iov_len = array_size - pvcalls_mask(cons, array_size);
                vec[1].iov_base = data->out;
                vec[1].iov_len = size - vec[0].iov_len;
-               iov_iter_kvec(&msg.msg_iter, READ, vec, 2, size);
+               iov_iter_kvec(&msg.msg_iter, WRITE, vec, 2, size);
        }
 
        atomic_set(&map->write, 0);