diff mbox series

vhost: fix VHOST_GET_BACKEND_FEATURES ioctl request definition

Message ID 20180903175906.GA11529@glebfm.cloud.tilaa.com (mailing list archive)
State New, archived
Headers show
Series vhost: fix VHOST_GET_BACKEND_FEATURES ioctl request definition | expand

Commit Message

Gleb Fotengauer-Malinovskiy Sept. 3, 2018, 5:59 p.m. UTC
The _IOC_READ flag fits this ioctl request more because this request
actually only writes to, but doesn't read from userspace.
See NOTEs in include/uapi/asm-generic/ioctl.h for more information.

Fixes: 429711aec282 ("vhost: switch to use new message format")
Signed-off-by: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
---
 include/uapi/linux/vhost.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael S. Tsirkin Sept. 4, 2018, 2:22 a.m. UTC | #1
On Mon, Sep 03, 2018 at 08:59:13PM +0300, Gleb Fotengauer-Malinovskiy wrote:
> The _IOC_READ flag fits this ioctl request more because this request
> actually only writes to, but doesn't read from userspace.
> See NOTEs in include/uapi/asm-generic/ioctl.h for more information.
> 
> Fixes: 429711aec282 ("vhost: switch to use new message format")
> Signed-off-by: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>

Hmm it does make sense, and it's not too late to fix this up.
Jason, what's your take on this? Was _IOW intentional?


> ---
>  include/uapi/linux/vhost.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/uapi/linux/vhost.h b/include/uapi/linux/vhost.h
> index b1e22c40c4b6..84c3de89696a 100644
> --- a/include/uapi/linux/vhost.h
> +++ b/include/uapi/linux/vhost.h
> @@ -176,7 +176,7 @@ struct vhost_memory {
>  #define VHOST_BACKEND_F_IOTLB_MSG_V2 0x1
>  
>  #define VHOST_SET_BACKEND_FEATURES _IOW(VHOST_VIRTIO, 0x25, __u64)
> -#define VHOST_GET_BACKEND_FEATURES _IOW(VHOST_VIRTIO, 0x26, __u64)
> +#define VHOST_GET_BACKEND_FEATURES _IOR(VHOST_VIRTIO, 0x26, __u64)
>  
>  /* VHOST_NET specific defines */
>  
> 
> -- 
> glebfm
Jason Wang Sept. 4, 2018, 3:08 a.m. UTC | #2
On 2018年09月04日 10:22, Michael S. Tsirkin wrote:
> On Mon, Sep 03, 2018 at 08:59:13PM +0300, Gleb Fotengauer-Malinovskiy wrote:
>> The _IOC_READ flag fits this ioctl request more because this request
>> actually only writes to, but doesn't read from userspace.
>> See NOTEs in include/uapi/asm-generic/ioctl.h for more information.
>>
>> Fixes: 429711aec282 ("vhost: switch to use new message format")
>> Signed-off-by: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
> Hmm it does make sense, and it's not too late to fix this up.
> Jason, what's your take on this? Was _IOW intentional?

My bad, not intentional. And I agree that fixing this is not too late.

So

Acked-by: Jason Wang <jasowang@redhat.com>

>
>> ---
>>   include/uapi/linux/vhost.h | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/include/uapi/linux/vhost.h b/include/uapi/linux/vhost.h
>> index b1e22c40c4b6..84c3de89696a 100644
>> --- a/include/uapi/linux/vhost.h
>> +++ b/include/uapi/linux/vhost.h
>> @@ -176,7 +176,7 @@ struct vhost_memory {
>>   #define VHOST_BACKEND_F_IOTLB_MSG_V2 0x1
>>   
>>   #define VHOST_SET_BACKEND_FEATURES _IOW(VHOST_VIRTIO, 0x25, __u64)
>> -#define VHOST_GET_BACKEND_FEATURES _IOW(VHOST_VIRTIO, 0x26, __u64)
>> +#define VHOST_GET_BACKEND_FEATURES _IOR(VHOST_VIRTIO, 0x26, __u64)
>>   
>>   /* VHOST_NET specific defines */
>>   
>>
>> -- 
>> glebfm
Michael S. Tsirkin Sept. 4, 2018, 3:11 a.m. UTC | #3
On Tue, Sep 04, 2018 at 11:08:40AM +0800, Jason Wang wrote:
> 
> 
> On 2018年09月04日 10:22, Michael S. Tsirkin wrote:
> > On Mon, Sep 03, 2018 at 08:59:13PM +0300, Gleb Fotengauer-Malinovskiy wrote:
> > > The _IOC_READ flag fits this ioctl request more because this request
> > > actually only writes to, but doesn't read from userspace.
> > > See NOTEs in include/uapi/asm-generic/ioctl.h for more information.
> > > 
> > > Fixes: 429711aec282 ("vhost: switch to use new message format")
> > > Signed-off-by: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
> > Hmm it does make sense, and it's not too late to fix this up.
> > Jason, what's your take on this? Was _IOW intentional?
> 
> My bad, not intentional. And I agree that fixing this is not too late.
> 
> So
> 
> Acked-by: Jason Wang <jasowang@redhat.com>


OK then

Acked-by: Michael S. Tsirkin <mst@redhat.com>

> > 
> > > ---
> > >   include/uapi/linux/vhost.h | 2 +-
> > >   1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/include/uapi/linux/vhost.h b/include/uapi/linux/vhost.h
> > > index b1e22c40c4b6..84c3de89696a 100644
> > > --- a/include/uapi/linux/vhost.h
> > > +++ b/include/uapi/linux/vhost.h
> > > @@ -176,7 +176,7 @@ struct vhost_memory {
> > >   #define VHOST_BACKEND_F_IOTLB_MSG_V2 0x1
> > >   #define VHOST_SET_BACKEND_FEATURES _IOW(VHOST_VIRTIO, 0x25, __u64)
> > > -#define VHOST_GET_BACKEND_FEATURES _IOW(VHOST_VIRTIO, 0x26, __u64)
> > > +#define VHOST_GET_BACKEND_FEATURES _IOR(VHOST_VIRTIO, 0x26, __u64)
> > >   /* VHOST_NET specific defines */
> > > 
> > > -- 
> > > glebfm
David Miller Sept. 4, 2018, 4:23 a.m. UTC | #4
From: "Michael S. Tsirkin" <mst@redhat.com>
Date: Mon, 3 Sep 2018 23:11:11 -0400

> On Tue, Sep 04, 2018 at 11:08:40AM +0800, Jason Wang wrote:
>> 
>> 
>> On 2018年09月04日 10:22, Michael S. Tsirkin wrote:
>> > On Mon, Sep 03, 2018 at 08:59:13PM +0300, Gleb Fotengauer-Malinovskiy wrote:
>> > > The _IOC_READ flag fits this ioctl request more because this request
>> > > actually only writes to, but doesn't read from userspace.
>> > > See NOTEs in include/uapi/asm-generic/ioctl.h for more information.
>> > > 
>> > > Fixes: 429711aec282 ("vhost: switch to use new message format")
>> > > Signed-off-by: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
>> > Hmm it does make sense, and it's not too late to fix this up.
>> > Jason, what's your take on this? Was _IOW intentional?
>> 
>> My bad, not intentional. And I agree that fixing this is not too late.
>> 
>> So
>> 
>> Acked-by: Jason Wang <jasowang@redhat.com>
> 
> 
> OK then
> 
> Acked-by: Michael S. Tsirkin <mst@redhat.com>

Applied, thanks everyone.
diff mbox series

Patch

diff --git a/include/uapi/linux/vhost.h b/include/uapi/linux/vhost.h
index b1e22c40c4b6..84c3de89696a 100644
--- a/include/uapi/linux/vhost.h
+++ b/include/uapi/linux/vhost.h
@@ -176,7 +176,7 @@  struct vhost_memory {
 #define VHOST_BACKEND_F_IOTLB_MSG_V2 0x1
 
 #define VHOST_SET_BACKEND_FEATURES _IOW(VHOST_VIRTIO, 0x25, __u64)
-#define VHOST_GET_BACKEND_FEATURES _IOW(VHOST_VIRTIO, 0x26, __u64)
+#define VHOST_GET_BACKEND_FEATURES _IOR(VHOST_VIRTIO, 0x26, __u64)
 
 /* VHOST_NET specific defines */