Skip to contentSkip to conversation

Question about 'dmsetup remove' and dtr of target_type

DISCUSSION Reng Zeng 2 participants 3 messages Nov 9, 2008 – Nov 10, 2008 Device mapper

lore
Share & tools
lore

Reng Zeng

author
#0 lore raw

Hi,

I suppose "dmsetup remove' will invoke dtr of target_type to remove the device.

However, I use "dmsetup remove" hundreds times, as the debug info, but it never enter the dtr function I defined.

Anybody have idea on this? Or how to dig into that to discover the reason? Thanks.

To be of more details, I have cache_target as below.
static struct target_type cache_target = {
...
.dtr = cache_dtr,
...
};
I add debug info into cache_dtr, it show it never enter into cache_dtr when I "dmsetup remove".

Thanks again,
Alan

#1 lore raw
Quoted 3 lines · Reng Zeng

However, I use "dmsetup remove" hundreds times, as the debug info, but it never enter the dtr function I defined.
Anybody have idea on this? Or how to dig into that to discover the reason?

Something still holds a reference to the table?
E.g. you have dm_table_get() without a matching dm_table_put() somewhere.

Try a debugger like kgdb? Check t->holders?

Or post your code here (assuming it's GPL) and someone might help.

Alasdair

Signature · 1 line
[email protected]
author
#2 lore raw

Thanks for reply, you are right, there may be something still holds a reference of that, which also cause the device busy after 'dmsetup remove'.

I figure out the reason is that, there is one "divide error" which may crash device mapper, I just do not expect that is the reason why destruction of target never got invoked.

Thanks very much.

Alan

2008/11/9 Alasdair G Kergon <[email protected]>

Quoted 22 lines · Reng Zeng
Quoted 3 lines

However, I use "dmsetup remove" hundreds times, as the debug info, but it never enter the dtr function I defined.
Anybody have idea on this? Or how to dig into that to discover the

reason?

Something still holds a reference to the table?
E.g. you have dm_table_get() without a matching dm_table_put() somewhere.

Try a debugger like kgdb? Check t->holders?

Or post your code here (assuming it's GPL) and someone might help.

Alasdair
--
[email protected]

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel