[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BY2PR0301MB165435669D72713F66DC4E6EA0460@BY2PR0301MB1654.namprd03.prod.outlook.com>
Date: Mon, 21 Sep 2015 16:31:32 +0000
From: KY Srinivasan <kys@...rosoft.com>
To: Olaf Hering <olaf@...fle.de>, Greg KH <gregkh@...uxfoundation.org>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"devel@...uxdriverproject.org" <devel@...uxdriverproject.org>,
"apw@...onical.com" <apw@...onical.com>,
"vkuznets@...hat.com" <vkuznets@...hat.com>,
"jasowang@...hat.com" <jasowang@...hat.com>
Subject: RE: [PATCH 4/5] hv: kvp: use wrappers to propaigate state
> -----Original Message-----
> From: Olaf Hering [mailto:olaf@...fle.de]
> Sent: Monday, September 21, 2015 3:18 AM
> To: KY Srinivasan <kys@...rosoft.com>; Greg KH
> <gregkh@...uxfoundation.org>
> Cc: linux-kernel@...r.kernel.org; devel@...uxdriverproject.org;
> apw@...onical.com; vkuznets@...hat.com; jasowang@...hat.com
> Subject: Re: [PATCH 4/5] hv: kvp: use wrappers to propaigate state
>
> On Sun, Sep 20, Greg KH wrote:
>
> > On Tue, Sep 15, 2015 at 05:37:53PM -0700, K. Y. Srinivasan wrote:
> > > @@ -122,8 +125,8 @@ static void kvp_timeout_func(struct work_struct
> *dummy)
>
> > > + if (kvp_get_state() > HVUTIL_READY)
> > > + kvp_set_state(HVUTIL_READY);
>
> > And what if the state changed the line after this? Oops, your code is
> > hosed. See, you need a lock, do this correctly.
>
> KY, can this happen?
No - the state has to be > HVUTIL_READY. Also, if the timeout fires,
it wins since other contexts will attempt to first cancel the timeout before
proceeding further.
K. Y
>
> Olaf
Powered by blists - more mailing lists