Paul Durrant
2013-Sep-20 13:57 UTC
[PATCH net-next v2 2/2] xen-netback: handle frontends that fail to transition through Closing
Some old Windows frontends fail to transition through the xenbus Closing state and move directly from Connected to Closed. Handle this case properly. Signed-off-by: Paul Durrant <paul.durrant@citrix.com> Cc: David Vrabel <david.vrabel@citrix.com> Cc: Wei Liu <wei.liu2@citrix.com> Cc: Ian Campbell <ian.campbell@citrix.com> --- drivers/net/xen-netback/xenbus.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c index a53782e..684b0f6 100644 --- a/drivers/net/xen-netback/xenbus.c +++ b/drivers/net/xen-netback/xenbus.c @@ -265,6 +265,13 @@ static void frontend_changed(struct xenbus_device *dev, break; case XenbusStateClosed: + /* + * Handle frontends which erroneously transition + * directly from Connected to Closed. + */ + if (dev->state == XenbusStateConnected) + disconnect_backend(dev); + xenbus_switch_state(dev, XenbusStateClosed); if (xenbus_dev_is_online(dev)) break; -- 1.7.10.4
Bastian Blank
2013-Sep-20 16:14 UTC
Re: [PATCH net-next v2 2/2] xen-netback: handle frontends that fail to transition through Closing
On Fri, Sep 20, 2013 at 02:57:40PM +0100, Paul Durrant wrote:> Some old Windows frontends fail to transition through the xenbus Closing > state and move directly from Connected to Closed. Handle this case properly.What happens in this case? Are there other state changes that will do unwanted things? Bastian -- If there are self-made purgatories, then we all have to live in them. -- Spock, "This Side of Paradise", stardate 3417.7
Paul Durrant
2013-Sep-23 08:59 UTC
Re: [PATCH net-next v2 2/2] xen-netback: handle frontends that fail to transition through Closing
> -----Original Message----- > From: Bastian Blank [mailto:bastian@waldi.eu.org] > Sent: 20 September 2013 17:15 > To: Paul Durrant > Cc: netdev@vger.kernel.org; xen-devel@lists.xen.org; Wei Liu; David Vrabel; > Ian Campbell > Subject: Re: [Xen-devel] [PATCH net-next v2 2/2] xen-netback: handle > frontends that fail to transition through Closing > > On Fri, Sep 20, 2013 at 02:57:40PM +0100, Paul Durrant wrote: > > Some old Windows frontends fail to transition through the xenbus Closing > > state and move directly from Connected to Closed. Handle this case > properly. > > What happens in this case? Are there other state changes that will do > unwanted things? >Hmm, now you mention it I suspect a transition directly to an unknown state may also not do the right thing. Perhaps it would be better to go straight to a more robust state model as suggested by David Vrabel. Paul