From 33465066c5eddaa6169814d645d543e5673bc2a6 Mon Sep 17 00:00:00 2001 From: Ondrej Kozina Date: Mon, 19 Oct 2015 16:56:45 +0200 Subject: [PATCH] polldaemon: fix missing mirror in-sync info with lvmpolld CONVERTING status flag is a tricky one. It's not set when converting a non-mirror LV type to the mirror type, i.e.: linear -> two leg mirror. Also the conversion itself is instant and doesn't require to be polled. When mirror reaches sync state there's no final update on VG metadata for lvmpolld to be made thereby report_progress in fact doesn't report percentage of mirror being converted but percentage of mirror being in sync. Perhaps we should reword the lvconvert output here. On the other hand CONVERTING is set while we upconvert the mirror from i.e. two leg mirror to four leg mirror. In such case the operation is required to be polled so that lvmpolld can cleanup temporary conversion log when the conversion is over. Ignore CONVERTING lv_type for the moment and match LVs only by uuids during 'mirror conversion'/'waiting for a sync to finish'. --- WHATS_NEW | 1 + tools/polldaemon.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/WHATS_NEW b/WHATS_NEW index f973f1176..763896eb3 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.133 - ====================================== + Fix missing in-sync progress info while lvconvert used with lvmpolld. Add report/compact_output_cols to lvm.conf to define report cols to compact. Do not change logging in lvm2 library when it's already set. Check for enough space in thin-pool in command before creating new thin. diff --git a/tools/polldaemon.c b/tools/polldaemon.c index cee1983f2..ccfaa7d71 100644 --- a/tools/polldaemon.c +++ b/tools/polldaemon.c @@ -412,7 +412,12 @@ static int report_progress(struct cmd_context *cmd, struct poll_operation_id *id if (lv && id->uuid && strcmp(id->uuid, (char *)&lv->lvid)) lv = NULL; - if (lv && parms->lv_type && !(lv->status & parms->lv_type)) + + /* + * CONVERTING is set only during mirror upconversion but we may need to + * read LV's progress info even when it's not converting (linear->mirror) + */ + if (lv && (parms->lv_type ^ CONVERTING) && !(lv->status & parms->lv_type)) lv = NULL; if (!lv) {