dm-thin: Fix deadlock with unknown device id If dm-thin device is created with unknown device id, the code calls dm_put(pool_md) twice. As a consequence, the reference count underflows and causes deadlock on device removal. Signed-off-by: Mikulas Patocka <mpatocka@xxxxxxxxxx> --- drivers/md/dm-thin.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Index: linux-3.0-fast/drivers/md/dm-thin.c =================================================================== --- linux-3.0-fast.orig/drivers/md/dm-thin.c 2011-08-04 17:31:16.000000000 +0200 +++ linux-3.0-fast/drivers/md/dm-thin.c 2011-08-04 17:31:26.000000000 +0200 @@ -2031,7 +2031,6 @@ static int thin_ctr(struct dm_target *ti goto bad_pool_lookup; } pool_inc(tc->pool); - dm_put(pool_md); r = dm_pool_open_thin_device(tc->pool->pmd, tc->dev_id, &tc->td); if (r) { @@ -2044,6 +2043,8 @@ static int thin_ctr(struct dm_target *ti ti->num_discard_requests = 0; ti->discards_supported = 0; + dm_put(pool_md); + return 0; bad_thin_open: -- dm-devel mailing list dm-devel@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/dm-devel