From 1abaaab1bc7b47b67a9ee35f11cc66e890fc60da Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Wed, 7 Sep 2011 13:42:00 +0000 Subject: [PATCH] Terminate pv_attr field correctly. (2.02.86) --- WHATS_NEW | 1 + lib/metadata/pv.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/WHATS_NEW b/WHATS_NEW index 7cc3ef9b5..573c98a88 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.89 - ================================== + Terminate pv_attr field correctly. (2.02.86) Fix 'not not' typo in pvcreate man page. Improve man page style for fsadm, lvreduce, lvremove, lvrename, lvresize. Support break for vgchange and vgrefresh operation. diff --git a/lib/metadata/pv.c b/lib/metadata/pv.c index 06920e587..f6c32b902 100644 --- a/lib/metadata/pv.c +++ b/lib/metadata/pv.c @@ -190,7 +190,7 @@ char *pv_attr_dup(struct dm_pool *mem, const struct physical_volume *pv) { char *repstr; - if (!(repstr = dm_pool_zalloc(mem, 3))) { + if (!(repstr = dm_pool_zalloc(mem, 4))) { log_error("dm_pool_alloc failed"); return NULL; } @@ -198,6 +198,7 @@ char *pv_attr_dup(struct dm_pool *mem, const struct physical_volume *pv) repstr[0] = (pv->status & ALLOCATABLE_PV) ? 'a' : '-'; repstr[1] = (pv->status & EXPORTED_VG) ? 'x' : '-'; repstr[2] = (pv->status & MISSING_PV) ? 'm' : '-'; + return repstr; }