Commit d54142c7 authored by Daniel Stodden's avatar Daniel Stodden Committed by Jens Axboe

blkfront: Klog the unclean release path

Signed-off-by: default avatarDaniel Stodden <daniel.stodden@citrix.com>
Signed-off-by: default avatarJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
parent 7b32d104
...@@ -1120,6 +1120,10 @@ static int blkfront_remove(struct xenbus_device *xbdev) ...@@ -1120,6 +1120,10 @@ static int blkfront_remove(struct xenbus_device *xbdev)
mutex_lock(&bdev->bd_mutex); mutex_lock(&bdev->bd_mutex);
info = disk->private_data; info = disk->private_data;
dev_warn(disk_to_dev(disk),
"%s was hot-unplugged, %d stale handles\n",
xbdev->nodename, bdev->bd_openers);
if (info && !bdev->bd_openers) { if (info && !bdev->bd_openers) {
xlvbd_release_gendisk(info); xlvbd_release_gendisk(info);
disk->private_data = NULL; disk->private_data = NULL;
...@@ -1191,6 +1195,7 @@ static int blkif_release(struct gendisk *disk, fmode_t mode) ...@@ -1191,6 +1195,7 @@ static int blkif_release(struct gendisk *disk, fmode_t mode)
if (xbdev && xbdev->state == XenbusStateClosing) { if (xbdev && xbdev->state == XenbusStateClosing) {
/* pending switch to state closed */ /* pending switch to state closed */
dev_info(disk_to_dev(bdev->bd_disk), "releasing disk\n");
xlvbd_release_gendisk(info); xlvbd_release_gendisk(info);
xenbus_frontend_closed(info->xbdev); xenbus_frontend_closed(info->xbdev);
} }
...@@ -1199,6 +1204,7 @@ static int blkif_release(struct gendisk *disk, fmode_t mode) ...@@ -1199,6 +1204,7 @@ static int blkif_release(struct gendisk *disk, fmode_t mode)
if (!xbdev) { if (!xbdev) {
/* sudden device removal */ /* sudden device removal */
dev_info(disk_to_dev(bdev->bd_disk), "releasing disk\n");
xlvbd_release_gendisk(info); xlvbd_release_gendisk(info);
disk->private_data = NULL; disk->private_data = NULL;
kfree(info); kfree(info);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment