Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d9dde59b authored by Jun'ichi Nomura's avatar Jun'ichi Nomura Committed by Linus Torvalds
Browse files

[PATCH] dm: missing bdput/thaw_bdev at removal



Need to unfreeze and release bdev otherwise the bdev inode with
inconsistent state is reused later and cause problem.

Signed-off-by: default avatarJun'ichi Nomura <j-nomura@ce.jp.nec.com>
Acked-by: default avatarAlasdair G Kergon <agk@redhat.com>
Cc: <stable@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 8dde0509
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -849,6 +849,10 @@ static struct mapped_device *alloc_dev(unsigned int minor, int persistent)

static void free_dev(struct mapped_device *md)
{
	if (md->suspended_bdev) {
		thaw_bdev(md->suspended_bdev, NULL);
		bdput(md->suspended_bdev);
	}
	free_minor(md->disk->first_minor);
	mempool_destroy(md->tio_pool);
	mempool_destroy(md->io_pool);