All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	kvm@vger.kernel.org, virtualization@lists.linux-foundation.org
Subject: Re: [PATCH net-next] vringh: fix copy direction of vringh_iov_push_kern()
Date: Mon, 28 Oct 2019 11:52:01 +0800	[thread overview]
Message-ID: <f8c51ab6-d328-b574-d5c4-ed4a8cd2c3ec__25258.8073186175$1572234742$gmane$org@redhat.com> (raw)
In-Reply-To: <20191027060328-mutt-send-email-mst@kernel.org>


On 2019/10/27 下午6:04, Michael S. Tsirkin wrote:
> On Thu, Oct 24, 2019 at 11:57:18AM +0800, Jason Wang wrote:
>> We want to copy from iov to buf, so the direction was wrong.
>>
>> Note: no real user for the helper, but it will be used by future
>> features.
>>
>> Signed-off-by: Jason Wang <jasowang@redhat.com>
> I'm still inclined to merge it now, incorrect code tends to
> proliferate.


I'm fine with this, so I believe you will merge this patch?

Thanks


>
>> ---
>>   drivers/vhost/vringh.c | 8 +++++++-
>>   1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/vhost/vringh.c b/drivers/vhost/vringh.c
>> index 08ad0d1f0476..a0a2d74967ef 100644
>> --- a/drivers/vhost/vringh.c
>> +++ b/drivers/vhost/vringh.c
>> @@ -852,6 +852,12 @@ static inline int xfer_kern(void *src, void *dst, size_t len)
>>   	return 0;
>>   }
>>   
>> +static inline int kern_xfer(void *dst, void *src, size_t len)
>> +{
>> +	memcpy(dst, src, len);
>> +	return 0;
>> +}
>> +
>>   /**
>>    * vringh_init_kern - initialize a vringh for a kernelspace vring.
>>    * @vrh: the vringh to initialize.
>> @@ -958,7 +964,7 @@ EXPORT_SYMBOL(vringh_iov_pull_kern);
>>   ssize_t vringh_iov_push_kern(struct vringh_kiov *wiov,
>>   			     const void *src, size_t len)
>>   {
>> -	return vringh_iov_xfer(wiov, (void *)src, len, xfer_kern);
>> +	return vringh_iov_xfer(wiov, (void *)src, len, kern_xfer);
>>   }
>>   EXPORT_SYMBOL(vringh_iov_push_kern);
>>   
>> -- 
>> 2.19.1

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

  parent reply	other threads:[~2019-10-28  3:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-24  3:57 [PATCH net-next] vringh: fix copy direction of vringh_iov_push_kern() Jason Wang
2019-10-27 10:04 ` Michael S. Tsirkin
2019-10-28  3:52   ` Jason Wang
2019-10-28  3:52   ` Jason Wang [this message]
2019-10-27 10:04 ` Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='f8c51ab6-d328-b574-d5c4-ed4a8cd2c3ec__25258.8073186175$1572234742$gmane$org@redhat.com' \
    --to=jasowang@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.