[PATCH] virtio_blk: decrement index when blockdevice is removed

From: Takuma Umeya
Date: Tue Apr 05 2011 - 00:50:56 EST


When virtio block device is removed, index does not get decremented. When
another virtio disk is attached it uses the next device letter to the
one that is suppose to be available.

Signed-off-by: Takuma Umeya <tumeya@xxxxxxxxxx>

diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 6ecf89c..730e7af 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -489,6 +489,7 @@ static void __devexit virtblk_remove(struct virtio_device *vdev)
mempool_destroy(vblk->pool);
vdev->config->del_vqs(vdev);
kfree(vblk);
+ index--;
}

static const struct virtio_device_id id_table[] = {

--
Umeya, Takuma
Technical Account Manager
Red Hat GSS APAC
+81.3.5798.8584 (direct)
tumeya@xxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/