* [PATCH] Add missing del_gendisk to error path
@ 2009-09-23 12:37 Zdenek Kabelac
2009-09-23 16:41 ` Jonathan Brassow
0 siblings, 1 reply; 2+ messages in thread
From: Zdenek Kabelac @ 2009-09-23 12:37 UTC (permalink / raw)
To: dm-devel, Milan Broz, Alasdair G Kergon
Add missing del_gendisk() to error path when creation of workqueue fails.
Otherwice there is a resource leak and following warning is shown:
WARNING: at fs/sysfs/dir.c:487 sysfs_add_one+0xc5/0x160()
sysfs: cannot create duplicate filename '/devices/virtual/block/dm-0'
Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
---
drivers/md/dm.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index b4845b1..bf5961d 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -1819,6 +1819,7 @@ static struct mapped_device *alloc_dev(int minor)
bad_bdev:
destroy_workqueue(md->wq);
bad_thread:
+ del_gendisk(md->disk);
put_disk(md->disk);
bad_disk:
blk_cleanup_queue(md->queue);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Add missing del_gendisk to error path
2009-09-23 12:37 [PATCH] Add missing del_gendisk to error path Zdenek Kabelac
@ 2009-09-23 16:41 ` Jonathan Brassow
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Brassow @ 2009-09-23 16:41 UTC (permalink / raw)
To: device-mapper development
Reviewed-by: Jonathan Brassow <jbrassow@redhat.com>
brassow
On Sep 23, 2009, at 7:37 AM, Zdenek Kabelac wrote:
> Add missing del_gendisk() to error path when creation of workqueue
> fails.
> Otherwice there is a resource leak and following warning is shown:
>
> WARNING: at fs/sysfs/dir.c:487 sysfs_add_one+0xc5/0x160()
> sysfs: cannot create duplicate filename '/devices/virtual/block/dm-0'
>
> Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
>
> ---
> drivers/md/dm.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/md/dm.c b/drivers/md/dm.c
> index b4845b1..bf5961d 100644
> --- a/drivers/md/dm.c
> +++ b/drivers/md/dm.c
> @@ -1819,6 +1819,7 @@ static struct mapped_device *alloc_dev(int
> minor)
> bad_bdev:
> destroy_workqueue(md->wq);
> bad_thread:
> + del_gendisk(md->disk);
> put_disk(md->disk);
> bad_disk:
> blk_cleanup_queue(md->queue);
>
> --
> dm-devel mailing list
> dm-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-09-23 16:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-23 12:37 [PATCH] Add missing del_gendisk to error path Zdenek Kabelac
2009-09-23 16:41 ` Jonathan Brassow
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.