From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932196AbaBDSyJ (ORCPT ); Tue, 4 Feb 2014 13:54:09 -0500 Received: from smtp02.citrix.com ([66.165.176.63]:32612 "EHLO SMTP02.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932115AbaBDSyF (ORCPT ); Tue, 4 Feb 2014 13:54:05 -0500 X-IronPort-AV: E=Sophos;i="4.95,781,1384300800"; d="scan'208";a="97897742" From: David Vrabel To: CC: David Vrabel , Konrad Rzeszutek Wilk , Boris Ostrovsky , , , Jens Axboe Subject: [PATCH] xen-blkfront: handle backend CLOSED without CLOSING Date: Tue, 4 Feb 2014 18:53:56 +0000 Message-ID: <1391540036-31087-1-git-send-email-david.vrabel@citrix.com> X-Mailer: git-send-email 1.7.2.5 MIME-Version: 1.0 Content-Type: text/plain X-DLP: MIA1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: David Vrabel Backend drivers shouldn't transistion to CLOSED unless the frontend is CLOSED. If a backend does transition to CLOSED too soon then the frontend may not see the CLOSING state and will not properly shutdown. So, treat an unexpected backend CLOSED state the same as CLOSING. Signed-off-by: David Vrabel Acked-by: Konrad Rzeszutek Wilk Cc: stable@vger.kernel.org --- Cc: Jens Axboe --- drivers/block/xen-blkfront.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 8dcfb54..0471d63 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c @@ -1904,13 +1904,16 @@ static void blkback_changed(struct xenbus_device *dev, case XenbusStateReconfiguring: case XenbusStateReconfigured: case XenbusStateUnknown: - case XenbusStateClosed: break; case XenbusStateConnected: blkfront_connect(info); break; + case XenbusStateClosed: + if (dev->state == XenbusStateClosed) + break; + /* Missed the backend's Closing state -- fallthrough */ case XenbusStateClosing: blkfront_closing(info); break; -- 1.7.2.5