diff mbox series

vhost: correct misleading printing information

Message ID 20240311082109.46773-1-xianting.tian@linux.alibaba.com (mailing list archive)
State New, archived
Headers show
Series vhost: correct misleading printing information | expand

Commit Message

Xianting Tian March 11, 2024, 8:21 a.m. UTC
Guest moved avail idx not used idx when we need to print log if
'(vq->avail_idx - last_avail_idx) > vq->num', so fix it.

Signed-off-by: Xianting Tian <xianting.tian@linux.alibaba.com>
---
 drivers/vhost/vhost.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Xianting Tian March 15, 2024, 7:53 a.m. UTC | #1
it is a very minor fix, I think it can be applied

在 2024/3/11 下午4:21, Xianting Tian 写道:
> Guest moved avail idx not used idx when we need to print log if
> '(vq->avail_idx - last_avail_idx) > vq->num', so fix it.
>
> Signed-off-by: Xianting Tian <xianting.tian@linux.alibaba.com>
> ---
>   drivers/vhost/vhost.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
> index 045f666b4f12..1f3604c79394 100644
> --- a/drivers/vhost/vhost.c
> +++ b/drivers/vhost/vhost.c
> @@ -2515,7 +2515,7 @@ int vhost_get_vq_desc(struct vhost_virtqueue *vq,
>   		vq->avail_idx = vhost16_to_cpu(vq, avail_idx);
>   
>   		if (unlikely((u16)(vq->avail_idx - last_avail_idx) > vq->num)) {
> -			vq_err(vq, "Guest moved used index from %u to %u",
> +			vq_err(vq, "Guest moved avail index from %u to %u",
>   				last_avail_idx, vq->avail_idx);
>   			return -EFAULT;
>   		}
diff mbox series

Patch

diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index 045f666b4f12..1f3604c79394 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -2515,7 +2515,7 @@  int vhost_get_vq_desc(struct vhost_virtqueue *vq,
 		vq->avail_idx = vhost16_to_cpu(vq, avail_idx);
 
 		if (unlikely((u16)(vq->avail_idx - last_avail_idx) > vq->num)) {
-			vq_err(vq, "Guest moved used index from %u to %u",
+			vq_err(vq, "Guest moved avail index from %u to %u",
 				last_avail_idx, vq->avail_idx);
 			return -EFAULT;
 		}