All of lore.kernel.org
 help / color / mirror / Atom feed
* [2.6.29 PATCH 01] dm table: rework reference counting fix
@ 2009-01-07 13:14 Alasdair G Kergon
  2009-01-07 13:43 ` Alasdair G Kergon
  2009-01-08 20:36 ` Jonathan Brassow
  0 siblings, 2 replies; 3+ messages in thread
From: Alasdair G Kergon @ 2009-01-07 13:14 UTC (permalink / raw)
  To: dm-devel

From: Mikulas Patocka <mpatocka@redhat.com>

Fix an error introduced in dm-table-rework-reference-counting.patch.

When there is failure after table initialization, we need to use
dm_table_destroy, not dm_table_put, to free the table.

dm_table_put may be used only after dm_table_get.

Cc: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
---
 drivers/md/dm-ioctl.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6.28/drivers/md/dm-ioctl.c
===================================================================
--- linux-2.6.28.orig/drivers/md/dm-ioctl.c	2009-01-06 15:07:04.000000000 +0000
+++ linux-2.6.28/drivers/md/dm-ioctl.c	2009-01-06 21:36:12.000000000 +0000
@@ -1064,7 +1064,7 @@ static int table_load(struct dm_ioctl *p
 
 	r = populate_table(t, param, param_size);
 	if (r) {
-		dm_table_put(t);
+		dm_table_destroy(t);
 		goto out;
 	}
 
@@ -1072,7 +1072,7 @@ static int table_load(struct dm_ioctl *p
 	hc = dm_get_mdptr(md);
 	if (!hc || hc->md != md) {
 		DMWARN("device has been removed from the dev hash table.");
-		dm_table_put(t);
+		dm_table_destroy(t);
 		up_write(&_hash_lock);
 		r = -ENXIO;
 		goto out;

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [2.6.29 PATCH 01] dm table: rework reference counting fix
  2009-01-07 13:14 [2.6.29 PATCH 01] dm table: rework reference counting fix Alasdair G Kergon
@ 2009-01-07 13:43 ` Alasdair G Kergon
  2009-01-08 20:36 ` Jonathan Brassow
  1 sibling, 0 replies; 3+ messages in thread
From: Alasdair G Kergon @ 2009-01-07 13:43 UTC (permalink / raw)
  To: dm-devel

On Wed, Jan 07, 2009 at 01:14:03PM +0000, Alasdair G Kergon wrote:
> From: Mikulas Patocka <mpatocka@redhat.com>
> Fix an error introduced in dm-table-rework-reference-counting.patch.
 
Reviewed-by: Alasdair G Kergon <agk@redhat.com>

Alasdair
-- 
agk@redhat.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [2.6.29 PATCH 01] dm table: rework reference counting fix
  2009-01-07 13:14 [2.6.29 PATCH 01] dm table: rework reference counting fix Alasdair G Kergon
  2009-01-07 13:43 ` Alasdair G Kergon
@ 2009-01-08 20:36 ` Jonathan Brassow
  1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Brassow @ 2009-01-08 20:36 UTC (permalink / raw)
  To: device-mapper development

Reviewed-by: Jonathan Brassow <jbrassow@redhat.com>

  brassow

On Jan 7, 2009, at 7:14 AM, Alasdair G Kergon wrote:

> From: Mikulas Patocka <mpatocka@redhat.com>
>
> Fix an error introduced in dm-table-rework-reference-counting.patch.
>
> When there is failure after table initialization, we need to use
> dm_table_destroy, not dm_table_put, to free the table.
>
> dm_table_put may be used only after dm_table_get.
>
> Cc: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
> ---
> drivers/md/dm-ioctl.c |    4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> Index: linux-2.6.28/drivers/md/dm-ioctl.c
> ===================================================================
> --- linux-2.6.28.orig/drivers/md/dm-ioctl.c	2009-01-06  
> 15:07:04.000000000 +0000
> +++ linux-2.6.28/drivers/md/dm-ioctl.c	2009-01-06 21:36:12.000000000  
> +0000
> @@ -1064,7 +1064,7 @@ static int table_load(struct dm_ioctl *p
>
> 	r = populate_table(t, param, param_size);
> 	if (r) {
> -		dm_table_put(t);
> +		dm_table_destroy(t);
> 		goto out;
> 	}
>
> @@ -1072,7 +1072,7 @@ static int table_load(struct dm_ioctl *p
> 	hc = dm_get_mdptr(md);
> 	if (!hc || hc->md != md) {
> 		DMWARN("device has been removed from the dev hash table.");
> -		dm_table_put(t);
> +		dm_table_destroy(t);
> 		up_write(&_hash_lock);
> 		r = -ENXIO;
> 		goto out;
>
> --
> dm-devel mailing list
> dm-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-01-08 20:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-07 13:14 [2.6.29 PATCH 01] dm table: rework reference counting fix Alasdair G Kergon
2009-01-07 13:43 ` Alasdair G Kergon
2009-01-08 20:36 ` 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.