[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CA+a=Yy5OMDSr12S3JZ3BeMhZKAZ0DAgOuAnSPG8TDw-wr-zzsg@mail.gmail.com>
Date: Thu, 8 Dec 2016 18:37:58 +0800
From: Peng Tao <bergwolf@...il.com>
To: Stefan Hajnoczi <stefanha@...il.com>
Cc: Stefan Hajnoczi <stefanha@...hat.com>, kvm@...r.kernel.org,
virtualization@...ts.linux-foundation.org,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH v2 1/4] vsock: track pkt owner vsock
On Thu, Dec 8, 2016 at 5:30 PM, Stefan Hajnoczi <stefanha@...il.com> wrote:
> On Wed, Dec 07, 2016 at 11:14:09PM +0800, Peng Tao wrote:
>> So that we can cancel a queued pkt later if necessary.
>>
>> Signed-off-by: Peng Tao <bergwolf@...il.com>
>> ---
>> include/linux/virtio_vsock.h | 2 ++
>> net/vmw_vsock/virtio_transport_common.c | 7 +++++++
>> 2 files changed, 9 insertions(+)
>>
>> diff --git a/include/linux/virtio_vsock.h b/include/linux/virtio_vsock.h
>> index 9638bfe..6dd3242 100644
>> --- a/include/linux/virtio_vsock.h
>> +++ b/include/linux/virtio_vsock.h
>> @@ -48,6 +48,7 @@ struct virtio_vsock_pkt {
>> struct virtio_vsock_hdr hdr;
>> struct work_struct work;
>> struct list_head list;
>> + struct vsock_sock *vsk;
>
> To prevent future bugs, please add a comment here:
> /* socket refcnt not held, only use for cancellation */
>
> This field is just an opaque token used for cancellation rather than a
> struct vsock_sock pointer that we are allowed to dereference. You could
> change this field to void *cancel_token to make the code harder to
> misuse.
Will do. Thanks!
Cheers,
Tao
Powered by blists - more mailing lists