Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 May 2017 08:57:00 +0000 (UTC)
From:      =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <royger@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r318918 - stable/11/sys/dev/xen/blkfront
Message-ID:  <201705260857.v4Q8v0fv013628@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: royger
Date: Fri May 26 08:57:00 2017
New Revision: 318918
URL: https://svnweb.freebsd.org/changeset/base/318918

Log:
  MFC r318520:
  
  xen/blkfront: correctly detach a disk with active users

Modified:
  stable/11/sys/dev/xen/blkfront/blkfront.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/xen/blkfront/blkfront.c
==============================================================================
--- stable/11/sys/dev/xen/blkfront/blkfront.c	Fri May 26 06:09:11 2017	(r318917)
+++ stable/11/sys/dev/xen/blkfront/blkfront.c	Fri May 26 08:57:00 2017	(r318918)
@@ -1578,11 +1578,14 @@ xbd_backend_changed(device_t dev, Xenbus
 		break;
 
 	case XenbusStateClosing:
-		if (sc->xbd_users > 0)
-			xenbus_dev_error(dev, -EBUSY,
-			    "Device in use; refusing to close");
-		else
+		if (sc->xbd_users > 0) {
+			device_printf(dev, "detaching with pending users\n");
+			KASSERT(sc->xbd_disk != NULL,
+			    ("NULL disk with pending users\n"));
+			disk_gone(sc->xbd_disk);
+		} else {
 			xbd_closing(dev);
+		}
 		break;	
 	}
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705260857.v4Q8v0fv013628>