]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
[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)
committerChris Wright <chrisw@sous-sol.org>
Wed, 1 Mar 2006 22:36:36 +0000 (14:36 -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>
[chrisw: backport to 2.6.15]
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
drivers/md/dm.c

index 930b9fc27953766e94b2ce8869f6228feb5f04b3..e0b63d7f5704dab15719b3ba5b5f8bf27538f0df 100644 (file)
@@ -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);