Bug #5186
closedkrbd: mapping same image produces ambiguous /dev file
0%
Description
Since it's possible to map the same image more than once,
the mechanism of putting an entry in /dev/rbd/rbd/<image>
is ambiguous. It turns out that you can actually use
that path as the device to unmap for an "rbd unmap" command,
but it isn't clear which actual device should be unmapped.
As an example, I mapped the same image 5 times (concurrently),
and it ended up being rbd1..rbd5. I unmapped /dev/rbd/rbd/image
and it removed rbd2. After that, /dev/rbd/rbd/image remained,
so unmapping using that again removed rbd5. The next one
removed rbd4, then rbd3, then finally rbd1. After the last
one /dev/rbd/rbd/image disappeared.
This ambiguity is too bad, because that path is a very useful
way to specify the device path for unmapping without knowing
the actual id that got assigned to it.
The easiest fix might be to simply disallow mapping a single
image more than once.