From: Jun'ichi Nomura Date: Fri, 24 Feb 2006 21:04:24 +0000 (-0800) Subject: [PATCH] dm: missing bdput/thaw_bdev at removal X-Git-Tag: v2.6.15.5~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2687a132e9d6e5e9249fc2b961ab37cf185dd3c8;p=thirdparty%2Fkernel%2Fstable.git [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: Jun'ichi Nomura Acked-by: Alasdair G Kergon Cc: Signed-off-by: Andrew Morton [chrisw: backport to 2.6.15] Signed-off-by: Chris Wright --- diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 930b9fc279537..e0b63d7f5704d 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -812,6 +812,10 @@ static struct mapped_device *alloc_dev(unsigned int minor, int persistent) static void free_dev(struct mapped_device *md) { + if (md->frozen_bdev) { + thaw_bdev(md->frozen_bdev, NULL); + bdput(md->frozen_bdev); + } free_minor(md->disk->first_minor); mempool_destroy(md->tio_pool); mempool_destroy(md->io_pool);