virtio-blk: fix remove oops

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Friday, May 2, 2008 - 9:59 am

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2e895e...
Commit:     2e895e4c23b7f73dba7238db5c5c2dcffb2a4d9d
Parent:     0527168522c25121bdd5d5f1d3c5b484d972ea14
Author:     Marcelo Tosatti <mtosatti@redhat.com>
AuthorDate: Thu Apr 24 15:49:53 2008 -0300
Committer:  Rusty Russell <rusty@rustcorp.com.au>
CommitDate: Fri May 2 21:50:46 2008 +1000

    virtio-blk: fix remove oops
    
    Do not unregister the major at device remove, since there might be
    another device instances around.
    
    (qemu) pci_del 0 11
    (qemu) ACPI: PCI interrupt for device 0000:00:0b.0 disabled
    (qemu) pci_del 0 10
    (qemu) ------------[ cut here ]------------
    WARNING: at block/genhd.c:126 unregister_blkdev+0x74/0x9e()
    ACPI: PCI interrupt for device 0000:00:0a.0 disabled
    
    Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
 drivers/block/virtio_blk.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index fb283af..7e83b6c 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -289,7 +289,6 @@ out:
 static void virtblk_remove(struct virtio_device *vdev)
 {
 	struct virtio_blk *vblk = vdev->priv;
-	int major = vblk->disk->major;
 
 	/* Nothing should be pending. */
 	BUG_ON(!list_empty(&vblk->reqs));
@@ -299,7 +298,6 @@ static void virtblk_remove(struct virtio_device *vdev)
 
 	blk_cleanup_queue(vblk->disk->queue);
 	put_disk(vblk->disk);
-	unregister_blkdev(major, "virtblk");
 	mempool_destroy(vblk->pool);
 	vdev->config->del_vq(vblk->vq);
 	kfree(vblk);
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
virtio-blk: fix remove oops, Linux Kernel Mailing ..., (Fri May 2, 9:59 am)