[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1a8f925a-13ea-a04e-1130-690fb0886bcd@redhat.com>
Date: Fri, 5 Feb 2021 11:18:07 +0800
From: Jason Wang <jasowang@...hat.com>
To: Stefano Garzarella <sgarzare@...hat.com>,
virtualization@...ts.linux-foundation.org
Cc: Xie Yongji <xieyongji@...edance.com>, kvm@...r.kernel.org,
Laurent Vivier <lvivier@...hat.com>,
Stefan Hajnoczi <stefanha@...hat.com>,
Max Gurtovoy <mgurtovoy@...dia.com>,
linux-kernel@...r.kernel.org, "Michael S. Tsirkin" <mst@...hat.com>
Subject: Re: [PATCH v3 03/13] vringh: reset kiov 'consumed' field in
__vringh_iov()
On 2021/2/5 上午1:22, Stefano Garzarella wrote:
> __vringh_iov() overwrites the contents of riov and wiov, in fact it
> resets the 'i' and 'used' fields, but also the 'consumed' field should
> be reset to avoid an inconsistent state.
>
> Signed-off-by: Stefano Garzarella <sgarzare@...hat.com>
> ---
> drivers/vhost/vringh.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Acked-by: Jason Wang <jasowang@...hat.com>
>
> diff --git a/drivers/vhost/vringh.c b/drivers/vhost/vringh.c
> index f68122705719..bee63d68201a 100644
> --- a/drivers/vhost/vringh.c
> +++ b/drivers/vhost/vringh.c
> @@ -290,9 +290,9 @@ __vringh_iov(struct vringh *vrh, u16 i,
> return -EINVAL;
>
> if (riov)
> - riov->i = riov->used = 0;
> + riov->i = riov->used = riov->consumed = 0;
> if (wiov)
> - wiov->i = wiov->used = 0;
> + wiov->i = wiov->used = wiov->consumed = 0;
>
> for (;;) {
> void *addr;
Powered by blists - more mailing lists