Skip to content

Commit

Permalink
blkfront: Klog the unclean release path
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
  • Loading branch information
Daniel Stodden authored and Jens Axboe committed Aug 7, 2010
1 parent 7b32d10 commit d54142c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/block/xen-blkfront.c
Original file line number Diff line number Diff line change
Expand Up @@ -1120,6 +1120,10 @@ static int blkfront_remove(struct xenbus_device *xbdev)
mutex_lock(&bdev->bd_mutex);
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) {
xlvbd_release_gendisk(info);
disk->private_data = NULL;
Expand Down Expand Up @@ -1191,6 +1195,7 @@ static int blkif_release(struct gendisk *disk, fmode_t mode)

if (xbdev && xbdev->state == XenbusStateClosing) {
/* pending switch to state closed */
dev_info(disk_to_dev(bdev->bd_disk), "releasing disk\n");
xlvbd_release_gendisk(info);
xenbus_frontend_closed(info->xbdev);
}
Expand All @@ -1199,6 +1204,7 @@ static int blkif_release(struct gendisk *disk, fmode_t mode)

if (!xbdev) {
/* sudden device removal */
dev_info(disk_to_dev(bdev->bd_disk), "releasing disk\n");
xlvbd_release_gendisk(info);
disk->private_data = NULL;
kfree(info);
Expand Down

0 comments on commit d54142c

Please sign in to comment.