virtio block devices names are not recycled

Bug #591469 reported by Scott Moser
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linux
New
Undecided
Unassigned
linux (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

I'm playing with eucalyptus, and attaching and detaching a block device as a virtio (bug 588410)
$ euca-attach-volume --instance ${inst} --device /dev/vdc ${vol}
VOLUME vol-5EC30651

Then,

$ euca-detach-volume ${vol}

The device names start as /dev/vda and go through to /dev/vdz and then to /dev/vdaa ...

The names are not recycled it would appear. In other buses (scsi) I'm used to the device name being recycled.

This can most likely be re-created without eucalyptus, using only kvm, but I dont' have those steps right at hand.

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: linux-image-2.6.34-4-virtual 2.6.34-4.11
Regression: No
Reproducible: Yes
ProcVersionSignature: User Name 2.6.34-4.11-virtual 2.6.34
Uname: Linux 2.6.34-4-virtual x86_64
AlsaDevices: Error: command ['ls', '-l', '/dev/snd/'] failed with exit code 2: ls: cannot access /dev/snd/: No such file or directory
AplayDevices: Error: [Errno 2] No such file or directory
Architecture: amd64
ArecordDevices: Error: [Errno 2] No such file or directory
Date: Tue Jun 8 21:29:41 2010
Lsusb: Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
MachineType: Bochs Bochs
PciMultimedia:

ProcCmdLine: root=/dev/sda1 console=ttyS0
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: linux
dmi.bios.date: 01/01/2007
dmi.bios.vendor: Bochs
dmi.bios.version: Bochs
dmi.chassis.type: 1
dmi.chassis.vendor: Bochs
dmi.modalias: dmi:bvnBochs:bvrBochs:bd01/01/2007:svnBochs:pnBochs:pvr:cvnBochs:ct1:cvr:
dmi.product.name: Bochs
dmi.sys.vendor: Bochs

Revision history for this message
Scott Moser (smoser) wrote :
Revision history for this message
Jeremy Foshee (jeremyfoshee) wrote :

Hi Scott,

If you could also please test the latest upstream kernel available that would be great. It will allow additional upstream developers to examine the issue. Refer to https://wiki.ubuntu.com/KernelMainlineBuilds . Once you've tested the upstream kernel, please remove the 'needs-upstream-testing' tag. This can be done by clicking on the yellow pencil icon next to the tag located at the bottom of the bug description and deleting the 'needs-upstream-testing' text. Please let us know your results.

Thanks in advance.

    [This is an automated message. Apologies if it has reached you inappropriately; please just reply to this message indicating so.]

tags: added: kj-triage
Changed in linux (Ubuntu):
status: New → Incomplete
Revision history for this message
Scott Moser (smoser) wrote :

I do not really have the time to test the upstream kernel. However, looking at the source of drivers/block/virtio_blk.c , I would guess that this bug does exist upstream. My (possibly to quick) read of virtblk_probe and virtblk_remove seem to me to be indicating the static variable "index" and never decrementing it. That variable is what is used to determine the next name in virtblk_probe.

Changed in linux (Ubuntu):
status: Incomplete → New
Revision history for this message
Scott Moser (smoser) wrote :

2 things.
a.) i just realized that the simple 'index--' wouldn't suffice as that would result in:
- add vda
- add vdb
- add vdc
- remove vdb
- add vdc !!
b.) i did reproduce with the upstream build linux-image-2.6.34-020634-generic .

Changed in linux (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
tags: added: kernel-needs-review kernel-uncat
removed: needs-upstream-testing
tags: added: kernel-candidate kernel-core kernel-reviewed
removed: kernel-needs-review kernel-uncat
Revision history for this message
John Johansen (jjohansen) wrote :

Scott,

your reading of the code is correct. Currently virtio_blk is not designed to recycle names, and this won't be possible until upstream changes this.

closing as invalid as this is the expected behavior.

Changed in linux (Ubuntu):
status: Triaged → Invalid
Revision history for this message
Scott Moser (smoser) wrote : Re: [Bug 591469] Re: virtio block devices names are not recycled

On Mon, 14 Jun 2010, John Johansen wrote:

> your reading of the code is correct. Currently virtio_blk is not
> designed to recycle names, and this won't be possible until upstream
> changes this.

So if I wanted that behavior, my option is basically to write a patch and
send to lkml ?

Revision history for this message
John Johansen (jjohansen) wrote :

Yes unfortunately. Though even if you had a patch they may not take it. The correct next step would be an email to the kvm development list (<email address hidden>) to discuss the behavior and see if such a change has any chance of going upstream.

tags: removed: kernel-candidate
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.