[dm-devel] Not able to create a device mapper target node

Mikulas Patocka mpatocka at redhat.com
Thu Jun 27 14:02:14 UTC 2013



On Mon, 24 Jun 2013, monica g wrote:

> Hi,
> 
> I wrote a basic device mapper driver which caches reads.
> 
> I gave dm msg prefix as below
>  #define DM_MSG_PREFIX "cacheread".
> 
> When i try to create a device mapper node using the below command
> echo "0 `blockdev --getsize /dev/sda2` cacheread /dev/sda2 0" | dmsetup
> create cacheread
> 
> the system hangs.I am not getting any error messages.
> 
> When i try to create a device mapper node for linear target(this target is
> already present with the device mapper code) using below command
> 
> echo "0 `blockdev --getsize /dev/sda2` linear /dev/sda2 0" | dmsetup create
> linear
> it succeeds and creates device node linear in /dev/mapper directory.
> 
> I am stuck with this issue and not able to proceed furthur.
> 
> Please let me know if you have any suggestions.
> 
> Any help is truely appreciated.
> 
> Thanks in advance.
> 
> Regards,
> Monica

Hi

How to debug hangs:

If the system is still responsive, just the process that loads your device 
mapper target hangs, switch to console and use Alt-Sysrq-W (or run
echo w >/proc/sysrq-trigger;dmesg ). It should display a stacktrace, and 
from the stacktrace you can find where did it hang.

Otherwise (if you can't get the stacktrace or you don't find the reason 
for the hang from the stacktrace), find a function that is the most likely 
cause (in your case, it would be the constructor of your device mapper 
target, if you don't find the hang in the constructor, try other 
functions, such as a map routine) and put statements such as 
printk("step1\n") ... printk("step2\n") ... printk("step3\n") ... etc at 
various places in that function. Switch to console (don't do it in 
x-window), load your target and from the messages printed on the console, 
you can find out where did the hang happen - for example, if it prints 
"step1" and "step2" and doesn't print "step3", you know that the hang 
happened between step2 and step3.

Mikulas


More information about the dm-devel mailing list