From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: Possible bug in xenbus __xenbus_switch_state Date: Thu, 4 Dec 2014 10:23:14 +0000 Message-ID: <54803612.4050508@citrix.com> References: <4841C18C109F9B4E86BBDE59113F98D7A8F52D@Exchange1.orionvm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4841C18C109F9B4E86BBDE59113F98D7A8F52D@Exchange1.orionvm.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Reimers , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On 04/12/14 09:40, Andrew Reimers wrote: > HI, > > Looking at the function __xenbus_switch_state in file source/drivers/xen/xenbus/xenbus_client.c, > > The comment says: > > "We check whether the state is currently set to the given value, and > if not, then the state is set." > > The code loads the old state value, but never does anything with it. It does: if (state == dev->state) return 0; The read of the state key is to check it still exists. "Furthermore, if the node has gone, we don't write to it, as the device will be tearing down, and we don't want to resurrect that directory." David