Re: lockdep warning when nesting dm devices

From: Alasdair G Kergon
Date: Sun Jul 16 2006 - 22:45:17 EST


On Sat, Jul 15, 2006 at 01:17:29PM +0200, Peter Osterlund wrote:
> # echo "0 10000 linear /dev/loop0 0" | /sbin/dmsetup create test
> # echo "0 10000 linear /dev/mapper/test 0" | /sbin/dmsetup create test2

> I get the following warning from the lockdep validator.
> =============================================
> [ INFO: possible recursive locking detected ]
> ---------------------------------------------

Well at first sight the message is simply pointing out something expected - it
only say "INFO" after all - viz. recursive use of
down_read(&md->io_lock);
something tied up with the split_bio horridness which needs to go away some
day. The lock prevents any attempt to suspend the device from happening
while a bio is in the process of being split into other bios.

Of course it's always helpful to review code from different perspectives
like this to look out for any gotchas and we ought to re-check the use
of this lock.

> Btw, is there a limit on how many dm devices can be chained? I guess
> there will be a kernel stack overflow if you try to chain together too
> many devices.

There's a patch in -mm which tackles that, but it needs some changes to dm
(which Milan Broz has begun working on) before it will behave correctly in all
cases.

Alasdair
--
agk@xxxxxxxxxx
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/