[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5d477777-28c2-af84-9b92-1a89d3f51067@oracle.com>
Date: Fri, 6 Oct 2017 16:31:11 -0400
From: Boris Ostrovsky <boris.ostrovsky@...cle.com>
To: Stefano Stabellini <sstabellini@...nel.org>
Cc: xen-devel@...ts.xen.org, linux-kernel@...r.kernel.org,
jgross@...e.com, Stefano Stabellini <stefano@...reto.com>
Subject: Re: [PATCH v4 02/13] xen/pvcalls: implement frontend disconnect
On 10/06/2017 04:29 PM, Stefano Stabellini wrote:
> On Fri, 6 Oct 2017, Boris Ostrovsky wrote:
>> On 10/06/2017 01:51 PM, Stefano Stabellini wrote:
>>> On Wed, 20 Sep 2017, Boris Ostrovsky wrote:
>>>>> +
>>>>> +struct pvcalls_bedata {
>>>>> + struct xen_pvcalls_front_ring ring;
>>>>> + grant_ref_t ref;
>>>>> + int irq;
>>>>> +
>>>>> + struct list_head socket_mappings;
>>>>> + struct list_head socketpass_mappings;
>>>>> + spinlock_t socket_lock;
>>>>> +
>>>>> + wait_queue_head_t inflight_req;
>>>>> + struct xen_pvcalls_response rsp[PVCALLS_NR_REQ_PER_RING];
>>>>> +};
>>>>> +static struct xenbus_device *pvcalls_front_dev;
>>>>> +static atomic_t pvcalls_refcount;
>>>> Should the refcount be per back/frontend?
>>> Yes it is, but only one back/frontend connection is supported by the
>>> frontend. I can add a comment.
>> Since it's per backend connection --- shouldn't it be part of struct
>> pvcalls_bedata?
> struct pvcalls_bedata is allocated with kzalloc. To protect accesses to
> it, pvcalls_refcount needs to be outside of it.
Oh, yes, of course. I think you also might be accessing it after the
struct is freed. Nevermind then.
-boris
Powered by blists - more mailing lists