dm table: rework reference counting fix
Alasdair G Kergon
maintainerPATCH 1/1 dm table: rework reference counting fix
From: Mikulas Patocka <[email protected]>
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.
--- drivers/md/dm-ioctl.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/md/dm-ioctl.c +2 -2
@@ -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;
Quoted 2 lines · Alasdair G Kergon
From: Mikulas Patocka <[email protected]>
Fix an error introduced in dm-table-rework-reference-counting.patch.
Alasdair
Signature · 1 line
[email protected]
brassow
Quoted 45 lines · Alasdair G Kergon
From: Mikulas Patocka <[email protected]>
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, notdm_table_put, to free the table.
dm_table_putmay be used only afterdm_table_get.Cc Kiyoshi Ueda <[email protected]>Signed-off-by Mikulas Patocka <[email protected]>Signed-off-by Alasdair G Kergon <[email protected]>---
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.c2009-01-06
15:07:04.000000000 +0000
+++linux-2.6.28/drivers/md/dm-ioctl.c2009-01-06 21:36:12.000000000
+0000drivers/md/dm-ioctl.c +2
-3@@ -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
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel