]> git.baikalelectronics.ru Git - kernel.git/commit
dm ioctl: fix hang in early create error condition
authorHelen Koike <helen.koike@collabora.com>
Wed, 15 May 2019 16:50:54 +0000 (13:50 -0300)
committerMike Snitzer <snitzer@redhat.com>
Thu, 16 May 2019 13:52:06 +0000 (09:52 -0400)
commit111d1b40229f2d7a95984c2c6e27b378fef8a3b9
treee56d03d13d08cb5b901e057dc008099e77e2809c
parent68f0b6140273874f3838c040d8465a665f8392d2
dm ioctl: fix hang in early create error condition

The dm_early_create() function (which deals with "dm-mod.create=" kernel
command line option) calls dm_hash_insert() who gets an extra reference
to the md object.

In case of failure, this reference wasn't being released, causing
dm_destroy() to hang, thus hanging the whole boot process.

Fix this by calling __hash_remove() in the error path.

Fixes: 6627539d9698e2 ("dm: add support to directly boot to a mapped device")
Cc: stable@vger.kernel.org
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-ioctl.c