summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2011-01-25 21:51:30 +0000
committerZdenek Kabelac <zkabelac@redhat.com>2011-01-25 21:51:30 +0000
commit4b79aeb0eafba4984d80b5916dce0fe421d976fd (patch)
tree9d152e3c45e9e53dd4e724602843f7bd24513093
parent67199cac4f9b8957ab85c82d169f99798924a434 (diff)
downloadlvm2-4b79aeb0eafba4984d80b5916dce0fe421d976fd.tar.gz
lvm2-4b79aeb0eafba4984d80b5916dce0fe421d976fd.tar.xz
lvm2-4b79aeb0eafba4984d80b5916dce0fe421d976fd.zip
Initialize pool object for each row
Fix assert abort of dmsetup (when compiled with pool debug) dmsetup splitname --nameprefixes --noheadings --rows gvg-a2 Move pool begin in the inner loop - otherwise it would using already 'ended' pool object.
-rw-r--r--WHATS_NEW_DM1
-rw-r--r--libdm/libdm-report.c10
2 files changed, 6 insertions, 5 deletions
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 1bafc2b5..efe51b47 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.62 -
===================================
+ Initialize pool object for each row in _output_as_rows().
Version 1.02.61 - 10th January 2011
===================================
diff --git a/libdm/libdm-report.c b/libdm/libdm-report.c
index 9b8e3c18..4f47c46e 100644
--- a/libdm/libdm-report.c
+++ b/libdm/libdm-report.c
@@ -1006,11 +1006,6 @@ static int _output_as_rows(struct dm_report *rh)
struct dm_report_field *field;
struct row *row;
- if (!dm_pool_begin_object(rh->mem, 512)) {
- log_error("dm_report: Unable to allocate output line");
- return 0;
- }
-
dm_list_iterate_items(fp, &rh->field_props) {
if (fp->flags & FLD_HIDDEN) {
dm_list_iterate_items(row, &rh->rows) {
@@ -1020,6 +1015,11 @@ static int _output_as_rows(struct dm_report *rh)
continue;
}
+ if (!dm_pool_begin_object(rh->mem, 512)) {
+ log_error("dm_report: Unable to allocate output line");
+ return 0;
+ }
+
if ((rh->flags & DM_REPORT_OUTPUT_HEADINGS)) {
if (!dm_pool_grow_object(rh->mem, rh->fields[fp->field_num].heading, 0)) {
log_error("dm_report: Failed to extend row for field name");