FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 08-04-2011, 03:35 PM
Mikulas Patocka
 
Default dm-thin: Fix deadlock with unknown device id

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@redhat.com>

---
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@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 08-04-2011, 03:55 PM
Mike Snitzer
 
Default dm-thin: Fix deadlock with unknown device id

On Thu, Aug 04 2011 at 11:35am -0400,
Mikulas Patocka <mpatocka@redhat.com> wrote:

> 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@redhat.com>

My fault. Thanks Mikulas.

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 

Thread Tools




All times are GMT. The time now is 07:51 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org