Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xen-blkfront: handle backend CLOSED without CLOSING

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 <david.vrabel@citrix.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: stable@vger.kernel.org
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

authored by

David Vrabel and committed by
Konrad Rzeszutek Wilk
36613717 80bfa2f6

+4 -1
+4 -1
drivers/block/xen-blkfront.c
··· 1904 1904 case XenbusStateReconfiguring: 1905 1905 case XenbusStateReconfigured: 1906 1906 case XenbusStateUnknown: 1907 - case XenbusStateClosed: 1908 1907 break; 1909 1908 1910 1909 case XenbusStateConnected: 1911 1910 blkfront_connect(info); 1912 1911 break; 1913 1912 1913 + case XenbusStateClosed: 1914 + if (dev->state == XenbusStateClosed) 1915 + break; 1916 + /* Missed the backend's Closing state -- fallthrough */ 1914 1917 case XenbusStateClosing: 1915 1918 blkfront_closing(info); 1916 1919 break;