]> 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)
commit38ce6c327d383c6fd4c5a71281c1aef897e6402d
treee56d03d13d08cb5b901e057dc008099e77e2809c
parent3b1064576e57b3f427e04c19078d6ae6257ca8b6
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: d947506a5e6084 ("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