All of lore.kernel.org
 help / color / mirror / Atom feed
* Not able to create a device mapper target node
@ 2013-06-24  7:19 monica g
  2013-06-25  8:19 ` Zdenek Kabelac
  2013-06-27 14:02 ` Mikulas Patocka
  0 siblings, 2 replies; 3+ messages in thread
From: monica g @ 2013-06-24  7:19 UTC (permalink / raw)
  To: dm-devel


[-- Attachment #1.1: Type: text/plain, Size: 814 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 1184 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Not able to create a device mapper target node
  2013-06-24  7:19 Not able to create a device mapper target node monica g
@ 2013-06-25  8:19 ` Zdenek Kabelac
  2013-06-27 14:02 ` Mikulas Patocka
  1 sibling, 0 replies; 3+ messages in thread
From: Zdenek Kabelac @ 2013-06-25  8:19 UTC (permalink / raw)
  To: device-mapper development; +Cc: monica g

Dne 24.6.2013 09:19, monica g napsal(a):
> 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.

Why not looking into a basic linear driver -

linux/drivers/md/dm-stripe.c

and start updating this driver for your needs.
Kernel device driver development is not easily debugable from userspace.

Also you might be interested to look at  dm-cache driver available from 3.9
kernel and which does much more advanced caching of reads as well as writes....

Regards

Zdenek


>
> 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
>
>
>
>
> --
> dm-devel mailing list
> dm-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Not able to create a device mapper target node
  2013-06-24  7:19 Not able to create a device mapper target node monica g
  2013-06-25  8:19 ` Zdenek Kabelac
@ 2013-06-27 14:02 ` Mikulas Patocka
  1 sibling, 0 replies; 3+ messages in thread
From: Mikulas Patocka @ 2013-06-27 14:02 UTC (permalink / raw)
  To: monica g; +Cc: device-mapper development

[-- Attachment #1: Type: TEXT/PLAIN, Size: 2017 bytes --]



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

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-06-27 14:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-24  7:19 Not able to create a device mapper target node monica g
2013-06-25  8:19 ` Zdenek Kabelac
2013-06-27 14:02 ` Mikulas Patocka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.