[dm-devel] possible bug in device-mapper
Kevin Corry
kevcorry at us.ibm.com
Fri Mar 19 21:15:33 UTC 2004
On Friday 19 March 2004 2:30 pm, Yaroslav Popovitch wrote:
> if option <sector count> is equal to 0, then dmsetup
> reports about error, but still creates device.
>
> Useful output:
> [root at deimos yp]# echo 0 0 crypt aes-plain
> 4e1243bd22c66e76c2ba9eddc1f91394 0 /dev/loop0 0|dmsetup create volume1
> device-mapper ioctl cmd 9 failed: Invalid argument
> Command failed
> [root at deimos yp]# echo $?
> 1
> [root at deimos yp]# dmsetup ls
> volume1 (254, 0)
> [root at deimos yp]# dmsetup mknodes
> [root at deimos yp]# lsmod /dev/mapper/
> control volume1
>
> Configuration:
> device-mapper-1.00.08
> Linux kernel 2.6.4
>
> Cheers,YP
What actually happened here is that you created a device called "volume1", and
then tried to load a table with a zero-length target, which isn't allowed.
The creation of the device worked as expected, and it's perfectly legitimate
to have a device without a table (you just can't perform any I/O on that
device).
The confusing thing here is that dmsetup allows you to combine these two steps
(creating the device and loading the table) into one. Dmsetup also allows you
to create the device without specifying the table, and you can later use
"dmsetup load" to load a table into that device, and "dmsetup resume" to
activate that table. The "combined" version is a carry-over from the way the
version 1 ioctl interface created devices.
So what you're really looking for here is that when you use "dmsetup create"
in the create-with-table mode, dmsetup should remove the device if the
load-table portion fails.
--
Kevin Corry
kevcorry at us.ibm.com
http://evms.sourceforge.net/
More information about the dm-devel
mailing list