[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] Possible bug in xenbus __xenbus_switch_state


  • To: "xen-devel@xxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxx>
  • From: Andrew Reimers <andrew.reimers@xxxxxxxxxxx>
  • Date: Thu, 4 Dec 2014 09:40:01 +0000
  • Accept-language: en-AU, en-US
  • Delivery-date: Thu, 04 Dec 2014 09:40:24 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>
  • Thread-index: AdAPpkaT2DfcOA3fSKWnN6ZNaeY4Qg==
  • Thread-topic: Possible bug in xenbus __xenbus_switch_state

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", &current_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
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.