* Possible bug in xenbus __xenbus_switch_state
@ 2014-12-04 9:40 Andrew Reimers
2014-12-04 10:23 ` David Vrabel
0 siblings, 1 reply; 2+ messages in thread
From: Andrew Reimers @ 2014-12-04 9:40 UTC (permalink / raw)
To: xen-devel@lists.xen.org
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.
I would expect it to look something like:
err = xenbus_scanf(xbt, dev->nodename, "state", "%d", ¤t_state);
if (err != 1 || current_state != state) {
err = xenbus_printf(xbt, dev->nodename, "state", "%d", state);
if (err) {
xenbus_switch_fatal(dev, depth, err, "writing new state");
goto abort;
}
}
--
Andrew Reimers
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: Possible bug in xenbus __xenbus_switch_state
2014-12-04 9:40 Possible bug in xenbus __xenbus_switch_state Andrew Reimers
@ 2014-12-04 10:23 ` David Vrabel
0 siblings, 0 replies; 2+ messages in thread
From: David Vrabel @ 2014-12-04 10:23 UTC (permalink / raw)
To: Andrew Reimers, xen-devel@lists.xen.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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-12-04 10:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-04 9:40 Possible bug in xenbus __xenbus_switch_state Andrew Reimers
2014-12-04 10:23 ` David Vrabel
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.