[PATCH] dm: missing bdput/thaw_bdev at removal
authorJun'ichi Nomura <j-nomura@ce.jp.nec.com>
Fri, 24 Feb 2006 21:04:24 +0000 (13:04 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 24 Feb 2006 22:31:39 +0000 (14:31 -0800)
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 <j-nomura@ce.jp.nec.com>
Acked-by: Alasdair G Kergon <agk@redhat.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/md/dm.c

index e9adeb9d172fa80c0f6140a6fcf4a034f4f0fdca..dad9e403d59de3ac4732f625d4c672f74647e925 100644 (file)
@@ -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);