dm-thin: free devices after block manager Free devices after block manager. The block manager may access the device on termination, so we must not close the device prematurely. Signed-off-by: Mikulas Patocka Index: linux-3.0-fast/drivers/md/dm-thin.c =================================================================== --- linux-3.0-fast.orig/drivers/md/dm-thin.c 2011-08-14 18:22:22.000000000 +0200 +++ linux-3.0-fast/drivers/md/dm-thin.c 2011-08-14 18:24:11.000000000 +0200 @@ -1425,10 +1425,12 @@ static void pool_dtr(struct dm_target *t { struct pool_c *pt = ti->private; - dm_put_device(ti, pt->metadata_dev); - dm_put_device(ti, pt->data_dev); unbind_control_target(pt->pool, ti); pool_dec(pt->pool); + + dm_put_device(ti, pt->metadata_dev); + dm_put_device(ti, pt->data_dev); + kfree(pt); }